import sys



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



S = sr()

day = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']

day = day[::-1]

i = day.index(S)

print((i+1))



import sys



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



S = sr()

days = 'SUN,MON,TUE,WED,THU,FRI,SAT'.split(',')

day_to_x = {x: 7 - i for i, x in enumerate(days)}



print((day_to_x[S]))

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
S = sr()
day = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
day = day[::-1]
i = day.index(S)
print((i + 1))

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
S = sr()
days = "SUN,MON,TUE,WED,THU,FRI,SAT".split(",")
day_to_x = {x: 7 - i for i, x in enumerate(days)}
print((day_to_x[S]))

-day = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"] -day = day[::-1] -i = day.index(S) -print((i + 1)) +days = "SUN,MON,TUE,WED,THU,FRI,SAT".split(",") +day_to_x = {x: 7 - i for i, x in enumerate(days)} +print((day_to_x[S]))