def cal(direction, pre_top, pre_front, pre_right)
    
    if direction == "North" then 
        top = pre_front
        front = 7 - pre_top
        right = pre_right
    
    elsif direction == "South" then
        top = 7 - pre_front
        front =pre_top
        right = pre_right
        
    elsif direction ==  "East" then
        top = 7 - pre_right
        front = pre_front
        right = pre_top
    
    elsif direction ==  "West" then
        top = pre_right
        front =pre_front
        right = 7 - pre_top

    elsif direction ==  "Right" then
        top = pre_top
        front = pre_right
        right = 7 - pre_front
    

    elsif direction ==  "Left" then
        top = pre_top
        front = 7 - pre_right
        right = pre_front
    
    else
        #printf("弾かれた%s %d" ,direction, direction.length)
    end
    
    return top, front, right
end



j = 0
while (j == 0)
num = gets
if num.to_i == 0 then
    break
end
top = 1
front = 2
right = 3
sum = 1
for i in 0..num.to_i-1 do
    order = gets
    #printf("%s", order)
    top, front, right = cal(order.chomp ,top,front, right)
    sum = sum + top
end

printf("%d\n",sum)
end
