program main
    implicit none
    integer(4):: i
    character(3), parameter:: week(7) = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
    character(3):: input_week
    read*, input_week

    do i = 1, 7
        if (week(i) == input_week) then
            print*, 8-i
        end if
    end do


end program main