input = gets
 
key = ['SUN','MON','TUE','WED','THU','FRI','SAT']
 
if input == key[0] then
    puts "7"
elsif input == key[1] then
    puts "6"
elsif input == key[2] then
    puts "5"
elsif input == key[3] then
    puts "4"
elsif input == key[4] then
    puts "3"
elsif input == key[5] then
    puts "2"
elsif input == key[6] then
    puts "1"
end