program main
  integer::n,i,j,k,ans
  !integer,allocatable::
  character(3)::day
read(*,*)day
select case(day)
case('SUN')
  ans=7
case('MON')
  ans=6
case('TUE')
  ans=5
case('WED')
  ans=4
case('THU')
  ans=3
case('FRI')
  ans=2
case('SAT')
  ans=1
end select

write(*,*) ans
end program
