#!/usr/bin/ruby

class Dice
  def initialize
    @num = { n:5, e:3, s:2, w:4, u:1, d:6 }
  end

  def move(d)
    case d
    when 'North' then
      tmp = @num[:u]
      @num[:u] = @num[:s]
      @num[:s] = @num[:d]
      @num[:d] = @num[:n]
      @num[:n] = tmp

    when 'East' then
      tmp = @num[:w]
      @num[:w] = @num[:d]
      @num[:d] = @num[:e]
      @num[:e] = @num[:u]
      @num[:u] = tmp

    when 'West' then
      tmp = @num[:u]
      @num[:u] = @num[:e]
      @num[:e] = @num[:d]
      @num[:d] = @num[:w]
      @num[:w] = tmp

    when 'South' then
      tmp = @num[:u]
      @num[:u] = @num[:n]
      @num[:n] = @num[:d]
      @num[:d] = @num[:s]
      @num[:s] = tmp

    when 'Right' then
      tmp = @num[:s]
      @num[:s] = @num[:e]
      @num[:e] = @num[:n]
      @num[:n] = @num[:w]
      @num[:w] = tmp

    when 'Left' then
      tmp = @num[:s]
      @num[:s] = @num[:w]
      @num[:w] = @num[:n]
      @num[:n] = @num[:e]
      @num[:e] = tmp

    end
  end

  def getPoint
    return @num[:u]
  end
end

loop do
  n = gets.to_i
  break if n == 0

  dice = Dice.new
  sum = dice.getPoint
  n.times do
    dice.move(gets.chomp!)
    sum += dice.getPoint
  end
  puts sum
end