Robot#87

Robot

1 second
128 megabytes
Very easy

An infinite strip of width is divided into 1 \times 1 cells. A robot is located in one of these cells (in the figure, the robot is marked with a square). The robot moves according to a sequence of commands, where each command is one of three uppercase Latin letters: , , or .

The commands are executed in order, starting from the robot's initial position.

\includegraphics{https://static.e-olymp.com/content/26/26e0fe4b79b5813a3437c5c8d7c864fe966b6320.jpg}

Write a program to determine how many distinct cells the robot visits during the execution of its program.

Input

The robot's program is given as a string consisting of the characters , , and . The string contains no more than 10^4 characters.

Output

Print the number of distinct cells visited by the robot while executing its program.

Examples

Example 1

Loading
Loading