while n = gets.to_i do
  if n == 0 then
    break
  end
  top = 1
  bottom = 6
  tate = [5, 2]
  yoko = [4, 3]
  sum = 1
  n.times do
    opt = gets.chomp

    if opt == "North" then
      tmp = top
      top = tate[1]
      tate[1] = bottom
      bottom = tate[0]
      tate[0] = tmp
    elsif opt == "East" then
      tmp = top
      top = yoko[0]
      yoko[0] = bottom
      bottom = yoko[1]
      yoko[1] = tmp
    elsif opt == "West" then
      tmp = top
      top = yoko[1]
      yoko[1] = bottom
      bottom = yoko[0]
      yoko[0] = tmp
    elsif opt == "South" then
      tmp = top
      top = tate[0]
      tate[0] = bottom
      bottom = tate[1]
      tate[1] = tmp
    elsif opt == "Right" then
      tmp = tate[0]
      tate[0] = yoko[0]
      yoko[0] = tate[1]
      tate[1] = yoko[1]
      yoko[1] = tmp
    elsif opt == "Left" then
      tmp = tate[0]
      tate[0] = yoko[1]
      yoko[1] = tate[1]
      tate[1] = yoko[0]
      yoko[0] = tmp
    end
    sum += top
  end
  puts sum
end