txt = gets.chomp

if txt == 'SUN'
  puts 7
elsif txt == 'MON'
  puts 6
elsif txt == 'TUE'
  puts 5
elsif txt == 'WED'
  puts 4
elsif txt == 'THU'
  puts 3
elsif txt == 'FRI'
  puts 2
elsif txt == 'SAT'
  puts 1
end