[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reada f = stdin.ReadLine().Split() |> Array.map f
let reads f = stdin.ReadLine().Split() |> Array.toList |> List.map f

[<EntryPoint>]
let main _ =
    let S = read string
    let n =
        match S with
        | "SUN" -> 7
        | "MON" -> 1
        | "TUE" -> 2
        | "WED" -> 3
        | "THU" -> 4
        | "FRI" -> 5
        | "SAT" -> 6
    if S = "SUN" then
        printfn "7"
    else
        printfn "%i" (7 - n)
    0