func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let ans = [
        "SUN": 7,
        "MON": 6,
        "TUE": 5,
        "WED": 4,
        "THU": 3,
        "FRI": 2,
        "SAT": 1,
    ]
    let s = readLine()!
    print(ans[s]!)
}

main()
