def main():

    S = eval(input())



    lst = ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]



    ans = 6 - lst.index(S)



    if ans == 0:

        ans = 7



    print(ans)





if __name__ == "__main__":

    main()

def main():

    S = eval(input())



    lst = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]



    ans = 7 - lst.index(S)



    print(ans)





if __name__ == "__main__":

    main()

def main():
    S = eval(input())
    lst = ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]
    ans = 6 - lst.index(S)
    if ans == 0:
        ans = 7
    print(ans)


if __name__ == "__main__":
    main()

def main():
    S = eval(input())
    lst = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
    ans = 7 - lst.index(S)
    print(ans)


if __name__ == "__main__":
    main()

-    lst = ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"] -    ans = 6 - lst.index(S) -    if ans == 0: -        ans = 7 +    lst = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"] +    ans = 7 - lst.index(S)