while n = gets.to_i
    exit if n==0
    top= 1
    front = 2
    side = 3
    sum = 1

    n.times do
        dr = gets.chomp!
        t = top
        f = front
        s =  side

        case dr
        when "North" then
            top = f
            front = 7- t
        when  "East" then
            side = t
            top = 7 - s
        when "West" then
            top = s
            side = 7 - t
        when "South" then
            front = t
            top = 7 - f
        when "Right" then
            front = s
            side = 7 - f
        when "Left" then
            side = f
            front = 7 - s
        else
        end
        
        sum += top
    end

    puts "#{sum}\n"
end

