﻿"""
Dice
"""

Top = 4

if __name__ == '__main__':
    while True:
        n = int(raw_input())
        if n == 0:
            break
        dice = [5, 4, 6, 3, 1, 2]
        result = 1
        for o in [raw_input().strip() for _ in xrange(n)]:
            if o == "North":
                dice = [dice[i] for i in [4, 1, 0, 3, 5, 2]]
            elif o == "East":
                dice = [dice[i] for i in [0, 2, 3, 4, 1, 5]]
            elif o == "West":
                dice = [dice[i] for i in [0, 4, 1, 2, 3, 5]]
            elif o == "South":
                dice = [dice[i] for i in [2, 1, 5, 3, 0, 4]]
            elif o == "Right":
                dice = [dice[i] for i in [1, 5, 2, 0, 4, 3]]
            elif o == "Left":
                dice = [dice[i] for i in [3, 0, 2, 5, 4, 1]]
            result += dice[Top]
        print result
