let sunday week = 
    if week = "MON" then 6
    else if week = "TUE" then 5
    else if week = "WED" then 4
    else if week = "THU" then 3
    else if week = "FRI" then 2
    else if week = "SAT" then 1
    else 7

let ans = sunday (read_line ())

let () = print_endline @@ string_of_int ans