/*
AizuOnline A1210
Title Die Game
*/
#include <stdio.h>
#include <string.h>

//Global data section
int N;
int top,north,west;
int nexttop,nextnorth,nextwest;
char buf[10];
char *d="NSWE";
//
main()
{
        int i,nextnum,dir;

        while(EOF!=scanf("%d",&N) && N)
        {
                top=1;north=2;west=3;
                for(i=0;i<N;i++)
                {
                        scanf("%s\n",buf);
                        dir=strchr(d,toupper(buf[0]))-d;
                        switch(dir)
                        {
                        case 0:
                                nexttop=7-north;
                                nextnorth=top;
                                nextwest=west;
                                break;
                        case 1:
                                nexttop=north;
                                nextnorth=7-top;
                                nextwest=west;
                                break;
                        case 2:
                                nexttop=7-west;
                                nextwest=top;
                                nextnorth=north;
                                break;
                        case 3: //dir:east w->t t->e
                                nexttop=west;
                                nextwest=7-top;
                                nextnorth=north;
                                break;
                                
                        }
                        top=nexttop;
                        north=nextnorth;
                        west = nextwest;
                }
                printf("%d\n",top);
        }
return(0);
}