S = gets.chomp
answer = 0
if S == "SUN"
    answer = 7
elsif S == "MON"
    answer = 6
elsif S == "TUE"
    answer = 5
elsif S == "WED"
    answer = 4
elsif S == "THU"
    answer = 3
elsif S == "FRI"
    answer = 2
elsif S == "SAT"
    answer = 1
end
puts answer