#include<iostream>
using namespace std;

class die{
private:
  int t,n,w,s,e,d;
public:
  die(){}
  die(int top,int north,int west){
    t=top;
    n=north;
    w=west;
    d=7-t;
    s=7-n;
    e=7-w;
  }
  void turn_north(){
    int tmp=n;
    n=t;
    t=s;
    s=d;
    d=tmp;
  }
  void turn_east(){
    int tmp=e;
    e=t;
    t=w;
    w=d;
    d=tmp;
  }
  void turn_south(){
    int tmp=s;
    s=t;
    t=n;
    n=d;
    d=tmp;
  }
  void turn_west(){
    int tmp=w;
    w=t;
    t=e;
    e=d;
    d=tmp;
  }
  void turn(string to){
    if(to=="north"){
      turn_north();
    }else if(to=="east"){
      turn_east();
    }else if(to=="south"){
      turn_south();
    }else if(to=="west"){
      turn_west();
    } 
  }
  int top(){
    return t;
  }
};

die D;
int n;
void init(){
  D=die(1,2,3);
}

bool input(){
  cin>>n;
  return n!=0;
}

int solve(){
  string in;
  for(int i=0;i<n;i++){
    cin>>in;
    D.turn(in);
  }
  return D.top();
}


int main(){
  while(init(),input()){
    cout<<solve()<<endl;
  }
}