ans = []
while (n = gets.to_i) != 0
  dice = {:top => 1, :front => 2, :right => 3}
  sum = 1

  n.times do
    direction = gets.chomp!
    top, front, right = dice[:top], dice[:front], dice[:right]

    case direction
    when 'North'
      dice[:top] = front
      dice[:front] = 7 - top
    when 'South'
      dice[:top] = 7 - front
      dice[:front] = top
    when 'East'
      dice[:top] = 7 - right
      dice[:right] = top
    when 'West'
      dice[:top] = right
      dice[:right] = 7 - top
    when 'Right'
      dice[:right] = 7 - front
      dice[:front] = right
    when 'Left'
      dice[:right] = front
      dice[:front] = 7 - right
    else
    end

    sum += dice[:top]
  end

  ans << sum
end

ans.each { |n| puts n }