# 変数作りすぎ、メモリ使用量も考えるべき
def turn(dir, dice)
  if dir == "North"
    tmpTop = dice[1]
    tmpBottom = dice[4]
    tmpFront = dice[5]
    tmpBack = dice[0]
    dice[0] = tmpTop
    dice[5] = tmpBottom
    dice[1] = tmpFront
    dice[4] = tmpBack
  elsif dir == "East"
    tmpTop = dice[3]
    tmpBottom = dice[2]
    tmpRight = dice[0]
    tmpLeft = dice[5]
    dice[0] = tmpTop
    dice[2] = tmpRight
    dice[3] = tmpLeft
    dice[5] = tmpBottom
  elsif dir == "West"
    tmpRight = dice[5]
    tmpLeft = dice[0]
    tmpTop = dice[2]
    tmpBottom = dice[3]
    dice[0] = tmpTop
    dice[2] = tmpRight
    dice[3] = tmpLeft
    dice[5] = tmpBottom
  elsif dir == "South"
    tmpTop = dice[4]
    tmpBottom = dice[1]
    tmpFront = dice[0]
    tmpBack = dice[5]
    dice[0] = tmpTop
    dice[5] = tmpBack
    dice[1] = tmpFront
    dice[4] = tmpBottom
  elsif dir == "Right"
    tmpRight = dice[4]
    tmpLeft = dice[1]
    tmpFront = dice[2]
    tmpBack = dice[3]
    dice[1] = tmpFront
    dice[2] = tmpRight
    dice[3] = tmpLeft
    dice[4] = tmpBack
  else dir == "Left"
    tmpRight = dice[1]
    tmpLeft = dice[4]
    tmpFront = dice[3]
    tmpBack = dice[2]
    dice[1] = tmpFront
    dice[2] = tmpRight
    dice[3] = tmpLeft
    dice[4] = tmpBack
  end
  return dice
end

def add()

end

loop do
  n = gets.chomp.to_i
  break if n == 0
  dice = [1,2,3,4,5,6]
  sum = dice[0]
  n.times do
    dir = gets.chomp
    turn(dir, dice)
    sum += dice[0]
  end
  puts sum
end

