function Dice() {
  this.top = 1;
  this.bottom = 6;
  this.front = 2;
  this.back = 5;
  this.left = 4;
  this.right = 3;
}

Dice.prototype.goNorth = function() {
  var temp = this.top;
  this.top = this.front;
  this.front = this.bottom;
  this.bottom = this.back;
  this.back = temp;
  return this.top;
};

Dice.prototype.goSouth = function() {
  var temp = this.top;
  this.top = this.back;
  this.back = this.bottom;
  this.bottom = this.front;
  this.front = temp;
  return this.top;
};

Dice.prototype.goEast = function() {
  var temp = this.top;
  this.top = this.left;
  this.left = this.bottom;
  this.bottom = this.right;
  this.right = temp;
  return this.top;
};

Dice.prototype.goWest = function() {
  var temp = this.top;
  this.top = this.right;
  this.right = this.bottom;
  this.bottom = this.left;
  this.left = temp;
  return this.top;
};

Dice.prototype.goLeft = function() {
  var temp = this.front;
  this.front = this.left;
  this.left = this.back;
  this.back = this.right;
  this.right = temp;
  return this.top;
};

Dice.prototype.goRight = function() {
  var temp = this.front;
  this.front = this.right;
  this.right = this.back;
  this.back = this.left;
  this.left = temp;
  return this.top;
};

Dice.prototype.move = function(dir) {
  switch (dir) {
    case 'North':
      return this.goNorth();
    case 'South':
      return this.goSouth();
    case 'East':
      return this.goEast();
    case 'West':
      return this.goWest();
    case 'Left':
      return this.goLeft();
    case 'Right':
      return this.goRight();
  }
};

(function(stdin) {
  var lines = stdin.trim().split('\n');
  while (1) {
    var n = Number(lines.shift().trim());
    if (n == 0) {
      break;
    }
    var sum = 1;
    var dice = new Dice();
    for (var i = 0; i < n; i++) {
      sum += dice.move(lines.shift().trim());
    }
    console.log(sum);
  }
})(require('fs').readFileSync('/dev/stdin', 'utf8'));