S = eval(input())



youbi = {

    'SUN':7,

    'MON':6,

    'TUE':5,

    'WED':4,

    'THU':3,

    'FRI':2,

    'SAT':1

}



print((youbi[S]))
S=["SUN","MON","TUE","WED","THU","FRI","SAT"]

T=eval(input())

if T=="SUN":

	print((7))

if T=="MON":

	print((6))

if T=="TUE":

	print((5))

if T=="WED":

	print((4))

if T=="THU":

	print((3))

if T=="FRI":

	print((2))

if T=="SAT":

	print((1))

S = eval(input())
youbi = {"SUN": 7, "MON": 6, "TUE": 5, "WED": 4, "THU": 3, "FRI": 2, "SAT": 1}
print((youbi[S]))

S = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
T = eval(input())
if T == "SUN":
    print((7))
if T == "MON":
    print((6))
if T == "TUE":
    print((5))
if T == "WED":
    print((4))
if T == "THU":
    print((3))
if T == "FRI":
    print((2))
if T == "SAT":
    print((1))

-S = eval(input()) -youbi = {"SUN": 7, "MON": 6, "TUE": 5, "WED": 4, "THU": 3, "FRI": 2, "SAT": 1} -print((youbi[S])) +S = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"] +T = eval(input()) +if T == "SUN": +    print((7)) +if T == "MON": +    print((6)) +if T == "TUE": +    print((5)) +if T == "WED": +    print((4)) +if T == "THU": +    print((3)) +if T == "FRI": +    print((2)) +if T == "SAT": +    print((1))