#encoding:utf-8 No.0502 2014.11.13
class Dice
  def initialize
    @top = 1
    @under = 6
    @north = 5
    @south = 2
    @east = 3
    @west =4
  end

  attr_accessor :top

  def north
    @top,@north,@under,@south = @south,@top,@north,@under
  end

  def south
    @top,@north,@under,@south = @north,@under,@south,@top
  end

  def east
    @top,@east,@under,@west = @west,@top,@east,@under
  end

  def west
    @top,@east,@under,@west = @east,@under,@west,@top
  end

  def right
    @north,@east,@south,@west = @west,@north,@east,@south
  end

  def left
    @north,@east,@south,@west = @east,@south,@west,@north
  end
end

while true
  dice = Dice.new
  sum = 1
  n = gets.chomp.to_i

  if n == 0
    break
  end

  n.times do
    case gets.chomp
    when "North"
      dice.north
      sum += dice.top
    when "South"
      dice.south
      sum += dice.top
    when "East"
      dice.east
      sum += dice.top
    when "West"
      dice.west
      sum += dice.top
    when "Right"
      dice.right
      sum += dice.top
    when "Left"
      dice.left
      sum += dice.top
    end
  end

  puts sum
end