program main
	implicit none
    character(3)::s
    integer::a(7)=(/7,6,5,4,3,2,1/)
    read(*,*)s
    if(s=='SUN')then
    	write(*,*)7
    else if(s=='MON')then
    	write(*,*)6
    else if(s=='TUE')then
    	write(*,*) 5
    else if(s=='WED')then
    	write(*,*) 4
    else if(s=='THU')then
    	write(*,*) 3
    else if(s=='FRI')then
    	write(*,*) 2
    else 
    	write(*,*) 1
    end if
    stop
end program main