# coding: utf-8



import sys

import math

import collections

import itertools

from inspect import currentframe

INF = 10 ** 10

MOD = 10 ** 9 + 7

def input() : return sys.stdin.readline().strip()

def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)

def lcm(x, y) : return (x * y) // gcd(x, y)

def I() : return int(eval(input()))

def MI() : return list(map(int, input().split()))

def LI() : return [int(x) for x in input().split()]

def RI(N) : return [int(eval(input())) for _ in range(N)]

def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]

def chkprint(*args) : names = {id(v):k for k,v in list(currentframe().f_back.f_locals.items())}; print((', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args)))



S = eval(input())



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

index = day.index(S)



print((7 - index))

# coding: utf-8



import sys

import math

import collections

import itertools

INF = 10 ** 10

MOD = 10 ** 9 + 7

def input() : return sys.stdin.readline().strip()

def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)

def lcm(x, y) : return (x * y) // gcd(x, y)

def I() : return int(input())

def LI() : return [int(x) for x in input().split()]

def RI(N) : return [int(input()) for _ in range(N)]

def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]

def PL(L) : print(*L, sep="\n")



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



S = input()

d = weeks.index(S)



print(7 - d)

# coding: utf-8
import sys
import math
import collections
import itertools
from inspect import currentframe

INF = 10**10
MOD = 10**9 + 7


def input():
    return sys.stdin.readline().strip()


def gcd(x, y):
    return y if x % y == 0 else gcd(y, x % y)


def lcm(x, y):
    return (x * y) // gcd(x, y)


def I():
    return int(eval(input()))


def MI():
    return list(map(int, input().split()))


def LI():
    return [int(x) for x in input().split()]


def RI(N):
    return [int(eval(input())) for _ in range(N)]


def LRI(N):
    return [[int(x) for x in input().split()] for _ in range(N)]


def chkprint(*args):
    names = {id(v): k for k, v in list(currentframe().f_back.f_locals.items())}
    print((", ".join(names.get(id(arg), "???") + " = " + repr(arg) for arg in args)))


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

# coding: utf-8
import sys
import math
import collections
import itertools

INF = 10**10
MOD = 10**9 + 7


def input():
    return sys.stdin.readline().strip()


def gcd(x, y):
    return y if x % y == 0 else gcd(y, x % y)


def lcm(x, y):
    return (x * y) // gcd(x, y)


def I():
    return int(input())


def LI():
    return [int(x) for x in input().split()]


def RI(N):
    return [int(input()) for _ in range(N)]


def LRI(N):
    return [[int(x) for x in input().split()] for _ in range(N)]


def PL(L):
    print(*L, sep="\n")


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

-from inspect import currentframe -    return int(eval(input())) - - -def MI(): -    return list(map(int, input().split())) +    return int(input()) -    return [int(eval(input())) for _ in range(N)] +    return [int(input()) for _ in range(N)] -def chkprint(*args): -    names = {id(v): k for k, v in list(currentframe().f_back.f_locals.items())} -    print((", ".join(names.get(id(arg), "???") + " = " + repr(arg) for arg in args))) +def PL(L): +    print(*L, sep="\n") -S = eval(input()) -day = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"] -index = day.index(S) -print((7 - index)) +weeks = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"] +S = input() +d = weeks.index(S) +print(7 - d)