program a
    implicit none
    character(len=3) :: S
    character(len=3) :: days(7)
    integer :: i

    read(*, *) S

    days(:) = ["SAT", "FRI", "THU", "WED", "TUE", "MON", "SUN"]

    do i = 1, 7
        if(S == days(i)) then
            print *, i
            exit
        endif
    end do

end program a