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