A die is placed in the orientation shown in the figure below.
For the die used here, as shown in this figure, when $1$ is on the top face and $2$ is on the south face, $3$ is on the east face. Since the sum of opposite faces of a die is always $7$, the hidden faces are $5$ on the north side, $4$ on the west side, and $6$ on the bottom side, respectively.
Starting from this initial configuration, we move the die according to instructions. Each instruction performs one of the following $6$ operations a number of times.
Each of the operations North, East, South, and West rotates the die by $90$ degrees in the indicated direction.
The $2$ operations Right and Left rotate the die by $90$ degrees horizontally while keeping the top and bottom faces as they are. (Be careful of the direction of rotation.)
Taking the number $1$ appearing on the top face in the initial configuration as the initial value, each time $1$ operation finishes, add the number appearing on the top face, and write a program that outputs the total sum when all operations have been completed according to the instructions.
Line $1$ of the input file contains the total number of instructions $n$, and each of the following $n$ lines contains $1$ instruction chosen from "North, East, South, West, Right, Left". Here, $n \le 10000$.
In the output file to be uploaded, insert a newline after the output (the total value).
Examples
Input 1
5 North North East South West
Output 1
21
Input 2
8 West North Left South Right North Left East
Output 2
34