using System;
using System.Collections.Generic;


namespace Dice
{
	class Program
	{
		static int Main ( string[] args )
		{
			while (true)
			{
				//??\???
				int orderCount = int.Parse (Console.ReadLine ().Trim ());

				if (orderCount == 0)
				{
					break;
				}

				string[] inputOrder = new string[orderCount];
				for (int lp = 0; lp < inputOrder.Length; lp++)
				{
					inputOrder[lp] = Console.ReadLine ().Trim ();
				}

				//??????
				Dice dice = new Dice ();
				int sum = 1;

				foreach (var item in inputOrder)
				{
					dice.Move (item);
					sum += dice.GetCenterValue ();
				}

				//??????
				Console.WriteLine (sum);

			}

			return 0;
		}

		class Dice
		{
			public Dice ()
			{
				this.Spot = new int[6];

				this.Spot[GetSpotNameValue (SpotName.North)] = 5;		//North
				this.Spot[GetSpotNameValue (SpotName.West)] = 4;		//West
				this.Spot[GetSpotNameValue (SpotName.Center)] = 1;		//Center
				this.Spot[GetSpotNameValue (SpotName.East)] = 3;		//East
				this.Spot[GetSpotNameValue (SpotName.South)] = 2;		//South
				this.Spot[GetSpotNameValue (SpotName.Temporary)] = 6;	//Back

				/* image
				 *	  5
				 *	4 1 3
				 *	  2
				 * tmp 6	
				 * 
				*/
			}

			private int[] Spot { set; get; }	//	????????????????????????????????°???????????????????´???????

			private enum SpotName : int
			{
				North = 0, West, Center, East, South, Temporary
			}
			//enum??????????????????????????????????????????????????°??????
			private int GetSpotNameValue ( SpotName spotName )
			{
				return (int) spotName;
			}
			//Center???????????°????????????
			public int GetCenterValue ()
			{
				return Spot[GetSpotNameValue (SpotName.Center)];
			}

			//?????°????????????????????????????????????
			public void Move ( string order )
			{
				switch (order)
				{
					case "North": MoveNorth (); break;
					case "West": MoveWest (); break;
					case "East": MoveEast (); break;
					case "South": MoveSouth (); break;
					case "Right": MoveRight (); break;
					case "Left": MoveLeft (); break;
					default: Console.WriteLine ("Error"); break;
				}
			}
			//????????????????§?????????????
			private void MoveNorth ()
			{
				int tmp = Spot[GetSpotNameValue (SpotName.North)];
				Spot[GetSpotNameValue (SpotName.North)] = Spot[GetSpotNameValue (SpotName.Center)];
				Spot[GetSpotNameValue (SpotName.Center)] = Spot[GetSpotNameValue (SpotName.South)];
				Spot[GetSpotNameValue (SpotName.South)] = Spot[GetSpotNameValue (SpotName.Temporary)];
				Spot[GetSpotNameValue (SpotName.Temporary)] = tmp;
			}
			private void MoveWest ()
			{
				int tmp = Spot[GetSpotNameValue (SpotName.West)];
				Spot[GetSpotNameValue (SpotName.West)] = Spot[GetSpotNameValue (SpotName.Center)];
				Spot[GetSpotNameValue (SpotName.Center)] = Spot[GetSpotNameValue (SpotName.East)];
				Spot[GetSpotNameValue (SpotName.East)] = Spot[GetSpotNameValue (SpotName.Temporary)];
				Spot[GetSpotNameValue (SpotName.Temporary)] = tmp;
			}
			private void MoveEast ()
			{
				int tmp = Spot[GetSpotNameValue (SpotName.East)];
				Spot[GetSpotNameValue (SpotName.East)] = Spot[GetSpotNameValue (SpotName.Center)];
				Spot[GetSpotNameValue (SpotName.Center)] = Spot[GetSpotNameValue (SpotName.West)];
				Spot[GetSpotNameValue (SpotName.West)] = Spot[GetSpotNameValue (SpotName.Temporary)];
				Spot[GetSpotNameValue (SpotName.Temporary)] = tmp;
			}
			private void MoveSouth ()
			{
				int tmp = Spot[GetSpotNameValue (SpotName.South)];
				Spot[GetSpotNameValue (SpotName.South)] = Spot[GetSpotNameValue (SpotName.Center)];
				Spot[GetSpotNameValue (SpotName.Center)] = Spot[GetSpotNameValue (SpotName.North)];
				Spot[GetSpotNameValue (SpotName.North)] = Spot[GetSpotNameValue (SpotName.Temporary)];
				Spot[GetSpotNameValue (SpotName.Temporary)] = tmp;
			}
			//???????????????????¨???????????????¢?????????
			private void MoveRight ()
			{
				int tmp = Spot[GetSpotNameValue (SpotName.North)];
				Spot[GetSpotNameValue (SpotName.North)] = Spot[GetSpotNameValue (SpotName.West)];
				Spot[GetSpotNameValue (SpotName.West)] = Spot[GetSpotNameValue (SpotName.South)];
				Spot[GetSpotNameValue (SpotName.South)] = Spot[GetSpotNameValue (SpotName.East)];
				Spot[GetSpotNameValue (SpotName.East)] = tmp;
			}
			//??????????????????????¨???????????????¢?????????
			private void MoveLeft ()
			{

				int tmp = Spot[GetSpotNameValue (SpotName.North)];
				Spot[GetSpotNameValue (SpotName.North)] = Spot[GetSpotNameValue (SpotName.East)];
				Spot[GetSpotNameValue (SpotName.East)] = Spot[GetSpotNameValue (SpotName.South)];
				Spot[GetSpotNameValue (SpotName.South)] = Spot[GetSpotNameValue (SpotName.West)];
				Spot[GetSpotNameValue (SpotName.West)] = tmp;
			}
		}
	}
}

Measured memory_bytes: 9336