
S = gets.chomp
a = ['SUN','MON','TUE','WED','THU','FRI','SAT']
c = a.index(S)
case c
when 0 then
  puts 7
when 1 then
  puts 6
when 2 then
  puts 5
when 3 then
  puts 4
when 4 then
  puts 3
when 5 then
  puts 2
else
  puts 1
end