program prob80
    implicit none
    character(3) :: s
    character(3) :: t(7)
    integer :: i
    read(*,*) s
    t = (/"SUN","MON","TUE","WED","THU","FRI","SAT"/)

    do i = 1, 7
        if(t(i) == s) then
            write(*,*) 8-i
        end if
    end do

    stop
contains
end program prob80