while true
    n = STDIN.gets.to_i
    exit 0 if n==0
    num = Hash.new
    num["t"] = 1
    num["b"] = 6
    num["s"] = 2
    num["n"] = 5
    num["e"] = 3
    num["w"] = 4
    total = num["t"]
    for i in 0..n-1 do
        str = STDIN.gets.chomp
        if str=="North" then
            tmp=num["t"]
            num["t"]=num["s"]
            num["s"]=num["b"]
            num["b"]=num["n"]
            num["n"]=tmp
        elsif str=="East" then
            tmp=num["t"]
            num["t"]=num["w"]
            num["w"]=num["b"]
            num["b"]=num["e"]
            num["e"]=tmp
        elsif str=="West" then
            tmp=num["t"]
            num["t"]=num["e"]
            num["e"]=num["b"]
            num["b"]=num["w"]
            num["w"]=tmp
        elsif str=="South" then
            tmp=num["t"]
            num["t"]=num["n"]
            num["n"]=num["b"]
            num["b"]=num["s"]
            num["s"]=tmp
        elsif str=="Right" then
            tmp=num["n"]
            num["n"]=num["w"]
            num["w"]=num["s"]
            num["s"]=num["e"]
            num["e"]=tmp
        elsif str=="Left" then
            tmp=num["n"]
            num["n"]=num["e"]
            num["e"]=num["s"]
            num["s"]=num["w"]
            num["w"]=tmp
        end
        total = total + num["t"]
    end
    print total,"\n"
end