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