LearnPy Hub
← Tuples & Sets problems
Medium

Places Visited

Start at (0, 0). Read a string of moves U, D, L, R (each moves one step). Store every point visited, including the start, as a tuple in a set and print how many different points were visited.

Input

One line of moves.

Output

One integer.

Sample 1

Input
UDLR
Output
3

Sample 2

Input
UUU
Output
4
solution.py
Output appears here
Places Visited · Python practice problem · LearnPy Hub