
input = gets

key = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

if input == key[0] then
    print 7
elsif input == key[1] then
    print 6
elsif input == key[2] then
    print 5
elsif input == key[3] then
    print 4
elsif input == key[4] then
    print 3
elsif input == key[5] then
    print 2
elsif input == key[6] then
    print 1
end