str=eval(input())

if(str=='SAT'):

	print('1')

elif(str=='SUN'):

	print('7')

elif(str=='MON'):

	print('6')

elif(str=='TUE'):

	print('5')

elif(str=='WED'):

	print('4')

elif(str=='THU'):

	print('3')

else:

	print('2')
s=eval(input())

if s=='SAT':

	print((1))

elif s=='SUN':

	print((7))

elif s=='MON':

	print((6))

elif s=='TUE':

	print((5))

elif s=='WED':

	print((4))

elif s=='THU':

	print((3))

else:

	print((2))
str = eval(input())
if str == "SAT":
    print("1")
elif str == "SUN":
    print("7")
elif str == "MON":
    print("6")
elif str == "TUE":
    print("5")
elif str == "WED":
    print("4")
elif str == "THU":
    print("3")
else:
    print("2")

s = eval(input())
if s == "SAT":
    print((1))
elif s == "SUN":
    print((7))
elif s == "MON":
    print((6))
elif s == "TUE":
    print((5))
elif s == "WED":
    print((4))
elif s == "THU":
    print((3))
else:
    print((2))

-str = eval(input()) -if str == "SAT": -    print("1") -elif str == "SUN": -    print("7") -elif str == "MON": -    print("6") -elif str == "TUE": -    print("5") -elif str == "WED": -    print("4") -elif str == "THU": -    print("3") +s = eval(input()) +if s == "SAT": +    print((1)) +elif s == "SUN": +    print((7)) +elif s == "MON": +    print((6)) +elif s == "TUE": +    print((5)) +elif s == "WED": +    print((4)) +elif s == "THU": +    print((3)) -    print("2") +    print((2))