Given is a string S representing the day of the week today.
S is SUN, MON, TUE, WED, THU, FRI, or SAT, for Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday, respectively.
After how many days is the next Sunday (tomorrow or later)?

-----Constraints-----
 - S is SUN, MON, TUE, WED, THU, FRI, or SAT.

-----Input-----
Input is given from Standard Input in the following format:
S

-----Output-----
Print the number of days before the next Sunday.

-----Sample Input-----
SAT

-----Sample Output-----
1

It is Saturday today, and tomorrow will be Sunday.

Difficulty: introductory

Starter code:

Solutions:
S = input()
W = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
print(7-W.index(S))

S = str(input())

day = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]
print(7 - day.index(S))

print(['SUN','MON','TUE','WED','THU','FRI','SAT'][::-1].index(input())+1)

S = input()
week = ["SUN","MON", "TUE", "WED", "THU", "FRI", "SAT"]
for i in range(7):
  if week[i] == S:
    print(7 - i)

week = ["SAT","FRI","THU","WED","TUE","MON","SUN"]
day = input()
print(week.index(day)+1)

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

S = input()

# 辞書型を使うとスッキリ書ける！
dic = {'SUN': 7, 'MON': 6, 'TUE': 5, 'WED': 4, 'THU': 3, 'FRI': 2, 'SAT': 1}
print(dic[S])

S = input()
DAY = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
for num in range(7):
  if DAY[num] == S:
    print((7-num))


S=['SUN','MON','TUE','WED','THU','FRI','SAT']
print(7-S.index(input()))

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

s=input()
if 'SU' in s:
  print('7')
if 'MO' in s:
  print('6')
if 'TU' in s:
  print('5')
if 'WE' in s:
  print('4')
if 'TH' in s:
  print('3')
if 'FR' in s:
  print('2')
if 'SA' in s:
  print('1')


week = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
s = input()
ans = 7 - week.index(s)
ans = ans if ans != 0 else 7
print(ans)

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

S = input()

print(7-days.index(S))

S = input()

if S == "SUN":
    print(7)
elif S == "MON":
    print(6)
elif S == "TUE":
    print(5)
elif S == "WED":
    print(4)
elif S == "THU":
    print(3)
elif S == "FRI":
    print(2)
else:
    print(1)

import sys
stdin=sys.stdin

ip=lambda: int(sp())

lp=lambda:list(map(int,stdin.readline().split()))
sp=lambda:stdin.readline().rstrip()

s=sp()

if s=='SUN':
  print((7))
elif s=='MON':
  print((6))
  
elif s=='TUE':
  print((5))
elif s=='WED':
  print((4))
elif s=='THU':
  print((3))
  
elif s=='FRI':
  print((2))
else:
  print((1))


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


# 問題：https://atcoder.jp/contests/abc146/tasks/abc146_a

week = ['SUN','MON','TUE','WED','THU','FRI','SAT']
s = input()
for i, day in enumerate(week):
    if day == s:
        res = 7 - i
        break
res = 7 - i
print(res)


s = input()

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

idx = week.index(s)
print(7-idx)

s=input()
a=["SUN","MON","TUE","WED","THU","FRI","SAT"]
print((7-a.index(s)))


a = input()

if a == "SUN":
    print("7")

elif a == "MON":
    print("6")

elif a == "TUE":
    print("5")

elif a == "WED":
    print("4")

elif a == "THU":
    print("3")

elif a == "FRI":
    print("2")

elif a == "SAT":
    print("1")

Week = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
S = input()
print(7 - Week.index(S))

S = input()
if S == 'SUN': print(7)
elif S == 'MON': print(6)
elif S == 'TUE': print(5)
elif S == 'WED': print(4)
elif S == 'THU': print(3)
elif S == 'FRI': print(2)
elif S == 'SAT': print(1) 

ls = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
S = input()
print(7-ls.index(S))

S = input()
l = ["SUN", "MON", "TUE", "WED", "THU", "FRI","SAT"]
print((7 - l.index(S)))


s = input()

if s == 'SAT':
    print(1)
if s == 'FRI':
    print(2)
if s == 'THU':
    print(3)
if s == 'WED':
    print(4)
if s == 'TUE':
    print(5)
if s == 'MON':
    print(6)
if s == 'SUN':
    print(7)

T = ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN']
S = input()
print(6-T.index(S) if S!='SUN' else 7)


s = str(input())
if s == "SUN":
    print((7))
    return()
if s == "MON":
    print((6))
    return()
if s == "TUE":
    print((5))
    return()
if s == "WED":
    print((4))
    return()
if s == "THU":
    print((3))
    return()
if s == "FRI":
    print((2))
    return()
if s == "SAT":
    print((1))
    return()


S=input()
day=["SUN","MON","TUE","WED","THU","FRI","SAT"]
for i in range(7):
    if day[i]==S:
        print((7-i))


import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inl = lambda: [int(x) for x in sys.stdin.readline().split()]
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

d = {
    "SAT": 1,
    "FRI": 2,
    "THU": 3,
    "WED": 4,
    "TUE": 5,
    "MON": 6,
    "SUN": 7,
}


def solve():
    S = ins()
    return d[S]


print(solve())


S=input()
l=["SUN","MON","TUE","WED","THU","FRI","SAT"]

for i in range(len(l)):
	if S==l[i]:
		print(7-i)
		break

S = input()
if S == 'SUN': print(7)
elif S == 'MON': print(6)
elif S == 'TUE': print(5)
elif S == 'WED': print(4)
elif S == 'THU': print(3)
elif S == 'FRI': print(2)
else: print(1) 

s = input()
dl = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
for i in range(7):
  if s == dl[i]:
    print(7-i)

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

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

s = input()

i = list.index(s)
answer = 7 - i

print(answer)

d=dict()
d["SUN"]=7
d["MON"]=6
d["TUE"]=5
d["WED"]=4
d["THU"]=3
d["FRI"]=2
d["SAT"]=1
s=input()
print(d[s])

S = input()
youbi = ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(youbi.index(S) + 1)

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

s=input()

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

a = input()
if a == 'SUN':
  print((7))
elif a == 'MON':
  print((6))
elif a == 'TUE':
  print((5))
elif a == 'WED':
  print((4))
elif a == 'THU':
  print((3))
elif a == 'FRI':
  print((2))
else:
  print((1))



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

S = input()

print(7 - yobi.index(S))

day = ['SUN','MON','TUE','WED','THU','FRI','SAT']
s = input()
for i in range(7):
    if s == day[i]:
        print(7-i)

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

s = input()
l = ["SAT","FRI","THU","WED","TUE","MON","SUN"]
print(l.index(s) + 1)

#ABC146A
s = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
ss = input()
print(7-s.index(ss))

S = input()
week = ["SUN", "MON", "TUE", "WED", "THU","FRI","SAT"]

print(7 - week.index(S))

S = input()

d = {'SUN':7,'MON':6,'TUE':5,'WED':4,'THU':3,'FRI':2,'SAT':1}
print((d[S]))
return()



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

S = str(input())

if S == 'SUN':
    print(7)
elif S == 'MON':
    print(6)
elif S == 'TUE':
    print(5)
elif S == 'WED':
    print(4)
elif S == 'THU':
    print(3)
elif S == 'FRI':
    print(2)
else:
    print(1)

s=input()

if s=='SUN':
    print((7))
if s=='MON':
    print((6))
if s=='TUE':
    print((5))
if s=='WED':
    print((4))
if s=='THU':
    print((3))
if s=='FRI':
    print((2))
if s=='SAT':
    print((1))


s = input()
l = ["SAT", "FRI", "THU", "WED", "TUE", "MON", "SUN"]
print(l.index(s)+1)

#!/usr/bin/env python3

wd = "SUN MON TUE WED THU FRI SAT".split()
wd = list(reversed(wd))

def solve(S: str):
    idx = wd.index(S)
    return idx+1


def main():
    S = input().strip()
    answer = solve(S)
    print(answer)

def __starting_point():
    main()

__starting_point()

l = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
s = input()
print((7 - l.index(s)))


import sys


def resolve(in_):
    S = next(in_).strip()
    _weekday = {0: 'SUN', 1: 'MON', 2: 'TUE', 3: 'WED', 4: 'THU', 5: 'FRI', 6: 'SAT'}
    weekday = {v: 7 - k for k, v in list(_weekday.items())}

    return weekday[S]


def main():
    answer = resolve(sys.stdin)
    print(answer)


def __starting_point():
    main()

__starting_point()

d={'SUN':1,'MON':2,'TUE':3,'WED':4,'THU':5,'FRI':6,'SAT':7}
today_key = input()
today_value = d[today_key]
nextsunday_value = 8-today_value
print(nextsunday_value)

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

S=str(input())

if S=='SUN':
    print(int(7-0))
elif S=='MON':
    print(int(7-1))
elif S=='TUE':
    print(int(7-2))
elif S=='WED':
    print(int(7-3))
elif S=='THU':
    print(int(7-4))
elif S=='FRI':
    print(int(7-5))
elif S=='SAT':
    print(int(7-6))

week=["SUN","MON","TUE","WED","THU","FRI","SAT"]
a=input()
print(7-week.index(a))

S=input()
D=['SUN','MON','TUE','WED','THU','FRI','SAT']
i=D.index(S)
print((7-i))


s = input()
s_list = ['SUN','MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - s_list.index(s))

S = input()
ls = [0,'SAT','FRI','THU','WED','TUE','MON','SUN']
print(ls.index(S))

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


days = ["SUN", 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
days.reverse()
d = input()
print((days.index(d)+1))


week = ['SUN',  'MON',  'TUE', 'WED', 'THU', 'FRI', 'SAT']
s = input()
i = week.index(s)
print(7 - i)

w=['SUN','MON','TUE','WED','THU','FRI','SAT']
print(7-w.index(input()))

S = input()
day_of_the_week = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
for i in range(len(day_of_the_week)):
    if S == day_of_the_week[i]:
        answer = 7 - i
print(answer)

def resolve():
    week = ['SUN','MON','TUE','WED','THU','FRI','SAT']
    s = input()
    print(7-week.index(s))
resolve()

week = "MON,TUE,WED,THU,FRI,SAT,SUN".split(',')
S = input()
print(7) if S=="SUN" else print(6-week.index(S))

N_List=["SUN","MON","TUE","WED","THU","FRI","SAT"]
print(7 - N_List.index(str(input())))

s = input()
arr = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
for i in range(7):
    if s==arr[i]:
        print(7-i)

week = ['SUN','MON','TUE','WED','THU','FRI','SAT']
s = input()
n = week.index(s)
print(7-n)

lis = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
S = input()
x = lis.index(S)
print(7-x)

#!/usr/bin/env python3
s = str(input())
if s == "SUN":
    print((7))
    return()
if s == "MON":
    print((6))
    return()
if s == "TUE":
    print((5))
    return()
if s == "WED":
    print((4))
    return()
if s == "THU":
    print((3))
    return()
if s == "FRI":
    print((2))
    return()
if s == "SAT":
    print((1))
    return()


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

n = input()

if n == 'SUN':
    print(7)
else:
    print(6 - li.index(n))

s = input()
S = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7-S.index(s))

print(7 - ['SUN','MON','TUE','WED','THU','FRI','SAT'].index(input()))

S=str(input())
st=['SUN','MON','TUE','WED','THU','FRI','SAT']
print((7-st.index(S)))


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

s = input()
lst = ['SUN','MON','TUE', 'WED', 'THU', 'FRI', 'SAT' ]
if s == 'SUN':
  print(7)
  return()
for i in range(7):
  if s == lst[i]:
    print(7-i)
    return()


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

S=input()
days=['MON','TUE','WED','THU','FRI','SAT','SUN']
cnt =days.index('SUN')-days.index(S)
if cnt==0:
  print(7)
else:
  print(cnt)

import math
from collections import Counter
from itertools import product

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

a = input()
day = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
for i in range(len(day)):
    if day[i] == a:
        print(7-i)

s = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
t = input()
i = s.index(t)
print(7 - i)

S = input()
day = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
print(7 - day.index(S))

w =['SUN','MON','TUE','WED','THU','FRI','SAT','SUN']
d = input()

i = w.index(d)
print((7-i))


s = input()

week = ['SUN','MON','TUE','WED','THU','FRI','SAT']
n = week.index(s)

print(7-n)

s = input()

t = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - t.index(s))

s=str(input())
dic={'SUN':7,'MON':6,'TUE':5,'WED':4,'THU':3,'FRI':2,'SAT':1 }
print(dic[s])

s = input()

if s == 'SUN':
    print(7)
elif s == 'MON':
    print(6)
elif s == 'TUE':
    print(5)
elif s == 'WED':
    print(4)
elif s == 'THU':
    print(3)
elif s == 'FRI':
    print(2)
elif s == 'SAT':
    print(1)

S = input()

lst = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
dct = {}
for i, j in enumerate(lst):
    dct[j] = i
print(7 - dct[S])

#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def solve():
    S = input()
    i = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"].index(S)
    print((7 - i))


def main():
    solve()


def __starting_point():
    main()

__starting_point()

S = input()
W = ['', 'SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']

print(W.index(S))

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

s = str(input())
if s == "SUN":
    print((7))
    return()
if s == "MON":
    print((6))
    return()
if s == "TUE":
    print((5))
    return()
if s == "WED":
    print((4))
    return()
if s == "THU":
    print((3))
    return()
if s == "FRI":
    print((2))
    return()
if s == "SAT":
    print((1))
    return()


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

s=input()
dic={"SUN":0,"MON":1,"TUE":2,"WED":3,"THU":4,"FRI":5,"SAT":6}
print(7-dic[s])

D = ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
S = input()
for i, d in enumerate(D):
    if d == S:
        print(i+1)
        return()

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

day = ["","SAT","FRI","THU","WED","TUE","MON","SUN"]
print(day.index(input()))

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

s=input()
L=['SUN','MON','TUE','WED','THU','FRI','SAT']

print((7-L.index(s)))