#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <queue>
#include <map>
#include <set>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<29;

struct N{
	int t,b,n,s,e,w;              // top bottom north south east west
	void roll(int d) {
		int tmp;
		if(d==0) {
			tmp=t; t=s; s=b; b=n; n=tmp;
		}else if(d==1) {
			tmp=t; t=e; e=b; b=w; w=tmp;
		}else if(d==2) {
			tmp=t; t=n; n=b; b=s; s=tmp;
		}else {
			tmp=t; t=w; w=b; b=e; e=tmp;
		}
	}
};


int main() {
  string a[] = {"north", "west", "south", "east"};
  map<string, int> mp;
  REP(i,4) mp[a[i]] = i;
  int n;
  while(cin>>n,n) {
    N dice;
    dice = (N){1,6,2,5,4,3};
    REP(i,n) {
      string s;
      cin >> s;
      dice.roll(mp[s]);
    }
    cout << dice.t<<endl;
  }
}