      PROGRAM piyo
      IMPLICIT NONE
      character(3) :: s
      integer :: ans
      
      read*,s
      
      
      if( s == 'MON' ) ans = 6
      if( s == 'TUE' ) ans = 5
      if( s == 'WED' ) ans = 4
      if( s == 'THU' ) ans = 3
      if( s == 'FRI' ) ans = 2
      if( s == 'SAT' ) ans = 1
      if( s == 'SUN' ) ans = 7
      
      
      print*,ans
      
      
      
      
      
      END PROGRAM