using System;

namespace AOJ.Volume5
{
    public class Dice
    {
        private class DiceInfo
        {
            public int Up { get; private set; }
            public int Down { get; private set; }
            public int North { get; private set; }
            public int South { get; private set; }
            public int East { get; private set; }
            public int West { get; private set; }

            public DiceInfo()
            {
                Up = 1;
                Down = 6;
                North = 5;
                South = 2;
                East = 3;
                West = 4;
            }

            public void MoveRight()
            {
                int tmp = North;
                North = West;
                West = South;
                South = East;
                East = tmp;
            }

            public void MoveLeft()
            {
                int tmp = North;
                North = East;
                East = South;
                South = West;
                West = tmp;
            }

            public void MoveNorth()
            {
                int tmp = Up;
                Up = South;
                South = Down;
                Down = North;
                North = tmp;
            }

            public void MoveSouth()
            {
                int tmp = Up;
                Up = North;
                North = Down;
                Down = South;
                South = tmp;
            }

            public void MoveEast()
            {
                int tmp = Up;
                Up = West;
                West = Down;
                Down = East;
                East = tmp;
            }

            public void MoveWest()
            {
                int tmp = Up;
                Up = East;
                East = Down;
                Down = West;
                West = tmp;
            }
        }

        public static int Main()
        {
            while (true)
            {
                int n = int.Parse(Console.ReadLine());
                if (n == 0) { break; }

                var dice = new DiceInfo();
                int answer = 1;
                for(int i = 0; i < n; i++)
                {
                    string command = Console.ReadLine();
                    switch (command)
                    {
                        case "North":
                            dice.MoveNorth();
                            break;
                        case "East":
                            dice.MoveEast();
                            break;
                        case "West":
                            dice.MoveWest();
                            break;
                        case "South":
                            dice.MoveSouth();
                            break;
                        case "Right":
                            dice.MoveRight();
                            break;
                        case "Left":
                            dice.MoveLeft();
                            break;
                    }
                    answer += dice.Up;
                }

                Console.WriteLine(answer);
            }
            return 0;
        }
    }
}

Measured memory_bytes: 9384