open System
let R T = stdin.ReadLine()|> T
let RS T = stdin.ReadLine().Split()|>Array.map T
let Mod = (1e9|>int64)+7L
[<EntryPoint>]
let main argv =
    let S = R string
    match S with
    | "SAT" -> 1
    | "FRI" -> 2
    | "THU" -> 3
    | "WED" -> 4
    | "TUE" -> 5
    | "MON" -> 6
    | _ -> 7
    |>stdout.WriteLine
    0
