Harryxun/stf_run huggingface dataset:
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')


### FIXED CODE ###

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')
N=int(input())
a=[int(i) for i in input().split()]

count=0
ans=0
for i in range(N):
    if a[i]<0:
        c+=1
        
a[i]=abs[i]
if c%2==0
    ans=sum(a)
else:
    a.sort()
    ans=sum(a)-a[0]

### FIXED CODE ###

N = int(input())

a = [int(i) for i in input().split()]

count=0
ans=0

for i in range(N):
    if a[i]<0:
        count+=1
    a[i]=abs(a[i])

if count%2==0:
    ans=sum(a)

else:
    a.sort()
    ans=sum(a)-a[0]*2

print(ans)
import sys
input = sys.stdin.readline

N, K = map(int, input().split())
H = [int(input()) for _ in range(N)]

if K >= N:
    print(0)
else:
    H.sort(reverse=True)
    for i in range(0, K):
        H.pop(i)

    print(sum(H))

### FIXED CODE ###

import sys
input = sys.stdin.readline

N, K = map(int, input().split())
H = list(map(int, input().split()))

if K >= N:
    print(0)
else:
    H.sort(reverse=True)
    print(sum(H[K:]))
s=[int(0) for i in range(26)]
while 1:
    x=[i for i in input()]
    if not x:
        break
    for i in range(len(x)):
        if 97<=ord(x[i].lower())<=122:
            s[ord(x[i].lower())-97]=s[ord(x[i].lower())-97]+1
for i in range(26):
    print(chr(97+i),":",s[i])

### FIXED CODE ###

s=[int(0) for i in range(26)]
while True:
    try:
        x=input()
        for i in range(len(list(x))):
            if 97<=ord(list(x)[i].lower())<=122:
                s[ord(list(x)[i].lower())-97]=s[ord(list(x)[i].lower())-97]+1
    except EOFError:
        break
for i in range(26):
    print(chr(97+i),":",s[i])
import sys
import bisect

def I(): return int(sys.stdin.readline().rstrip())
def LI():return list(map(int,sys.stdin.readline().rstrip().split()))
def LS():return list(sys.stdin.readline().rstrip().split())


def main():
  X,N = LI()[:]
  P = LI()
  P.sort()
  #print(X,N)
  #print(P)

  if N==0:
    print(X)
    exit()
    
  index = bisect.bisect_left(P, X)
  
  l = index
  r = index
  for i in range(0,100):
    up = X + i
    down = X - i
    
    if l < 0:
      print(down)
      break
    
    if r > N:
      print(up)
      break
     
    # Left優先
    if P[l] != down:
      print(down)
      break
     
    if P[r] != up:
      print(up)
      break
    
    l -= 1
    r += 1
    
if __name__ == '__main__':
	main()


### FIXED CODE ###

import sys
import bisect

def I(): return int(sys.stdin.readline().rstrip())
def LI():return list(map(int,sys.stdin.readline().rstrip().split()))
def LS():return list(sys.stdin.readline().rstrip().split())


def main():
  X,N = LI()[:]
  if N > 0:
    P = LI()
    P.sort()
  else:
    print(X)
    exit()
  
  #print(X,N)
  #print(P)
  
  index = bisect.bisect_left(P, X)
  #print("index=",index)
  if index >= N :
    print(X)
    exit()
    
  l = index
  r = index
  for i in range(0,200):
    up = X + i
    down = X - i
    
    #print("l=",l,"r=",r)
     
    # Left優先
    if l < 0 or P[l] != down:
      print(down)
      break

    if r >= N or P[r] != up:
      print(up)
      break
    
    l -= 1
    r += 1
    
if __name__ == '__main__':
	main()
N = int(input())
X = input()   
              
memo = {}     
x_val = int(X, 2)
pc_x = X.count('1')
              
x_mod_pc_x_plus_1 = x_val % (pc_x + 1)
x_mod_pc_x_minus_1 = x_val % (pc_x - 1)
              
for i in range(N):
    if X[i] == '1':
        pc = pc_x - 1
        if pc == 0:
            print(0)
            continue
        val = (x_mod_pc_x_minus_1 - pow(2, N-i-1, pc)) % pc
    else:     
        pc = pc_x + 1
        val = (x_mod_pc_x_plus_1 + pow(2, N-i-1, pc)) % pc
    ans = 1   
    while val > 0:
        val %= bin(val).count('1')
        ans += 1
    print(ans)
              
              


### FIXED CODE ###

N = int(input())
X = input()   
              
x_val = int(X, 2)
pc_x = X.count('1')
              
x_mod_pc_x_plus_1 = x_val % (pc_x + 1)
x_mod_pc_x_minus_1 = x_val % max(pc_x - 1, 1)
              
for i in range(N):
    if X[i] == '1':
        pc = pc_x - 1
        if pc == 0:
            print(0)
            continue
        val = (x_mod_pc_x_minus_1 - pow(2, N-i-1, pc)) % pc
    else:     
        pc = pc_x + 1
        val = (x_mod_pc_x_plus_1 + pow(2, N-i-1, pc)) % pc
    ans = 1   
    while val > 0:
        val %= bin(val).count('1')
        ans += 1
    print(ans)
n=int(input())
b=list(map(int,input().split()))
a=[]
for i in b:
    for j in b:
        if i>=max(b[j],b[i]):
            a.append(max(b[j],b[j+1]))
print(sum(a))

### FIXED CODE ###

N = int(input())
B = [int(i) for i in input().split()]

A = [0 for i in range(N)]
A[0] = B[0]
for i in range(N-1):
    A[i] = min(A[i], B[i])
    A[i+1] = B[i]

print(sum(A))
print(input()-1)

### FIXED CODE ###

str_K = input()
k = int(str_K)
tmp_list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(tmp_list[k-1])
n = int(input())

lst = [1] * (n + 1)
if n == 1:
  print(0)
else:
  count = 0
  num = n
  for i in range(2, n + 1):
    if lst[i] == 0:
      continue
    for j in range(i, n + 1, i):
      lst[j] = 0
      if num % j == 0:
        num /= j
        count += 1
      if num % j == num:
        break
    if num == 1:
      break
  print(count)

### FIXED CODE ###

n = int(input())

lst = []
while n % 2 == 0:
  lst.append(2)
  n //= 2
f = 3
while f * f <= n:
  if n % f == 0:
    lst.append(f)
    n //= f
  else:
    f += 2
if n != 1:
  lst.append(n)
#print(lst)
count = 0
while lst:
  s = 0
  i = 1
  num = lst[0]
  for ele in lst:
    if ele == num:
      s += 1
  for j in range(s):
    lst.remove(num)
  while s > 0:
    s -= i
    i += 1
    if s >= 0:
      count += 1
  #print(lst)
print(count)
import math
N,M = map(int,input().split())
S = input()
T = input()

flag = True
for n in range(N):
    if M*n%N==0:
        m = M*n//N
        flag = S[n]==T[m]
        if not flag:
            break
if not flag:
    print(-1)
else:
    print(N*M//math.gcd(N,M))


### FIXED CODE ###

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
    
N,M = map(int,input().split())
s = input()
t = input()
g = gcd(N,M)
l = N*M//g

n = N//g
m = M//g

ans = l

for i in range(g):
    if s[i*n]!=t[i*m]:
        ans = -1
        break
print(ans)
#include <cstdio>
#include <algorithm>
using namespace std;
struct me{
    int x,y;
}a[105],b[105];
bool f[105];
bool cmp1(struct me v1,struct me v2){
    return v1.y>v2.y;
}
bool cmp2(struct me v1,struct me v2){
    return v1.x+v1.y<v2.x+v2.y;
}
int main(){
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&a[i].x,&a[i].y);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&b[i].x,&b[i].y);
    //sort(a+1, a+1+n, cmp1);
    sort(b+1, b+1+n, cmp2);
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(f[j]==false&&a[j].x<b[i].x&&a[j].y<b[i].y){
                f[j]=true;
                break;
            }
        }
    }
    int s=0;
    for(int i=1;i<=n;i++)
        if(f[i]==true)
            s++;
    printf("%d\n",s);
    return 0;
}


### FIXED CODE ###

N=int(raw_input())
ab=[]
cd=[]
for i in xrange(N):
 ab.append(map(int,raw_input().split()))
for i in xrange(N):
 cd.append(map(int,raw_input().split()))
ab.sort(key=lambda x:x[1],reverse=True)
cd.sort()
for c,d in cd:
 for a,b in ab:
  if a<c and b<d:
   ab.remove([a,b])
   break
print N-len(ab)
N,S=input().split()
ans=1
c=[1]*26
for i in S:
        c[ord(i)-ord('a')]+=1
for i in c:
        ans*=i
print(ans%1000000007-1)

### FIXED CODE ###

S=input()
S=input()
ans=1
c=[1]*26
for i in S:
        c[ord(i)-ord('a')]+=1
for i in c:
        ans*=i
print(ans%1000000007-1)
# coding: utf-8

from itertools import product as prod
import sys
input = sys.stdin.readline

mod = int(1e9 + 7)

def f2(K, D):
    l = len(K)
    dp = [[[0] * D for _ in range(2)] for _ in range(l + 1)]
    dp[0][0][0] = 1

    for i, j, d in prod(range(l), range(2), range(D)):
        maxk = 9 if j else int(K[i])
        dpij = dp[i][j]
        dpi1 = dp[i + 1]
        for k in range(maxk + 1):
            dpi1j = dpi1[j or k < maxk]
            d_ = d + k
            if d_ >= D:
                d_ -= D
            dpi1j[d_] += dpij[d]
            if dpi1j[d_] >= mod:
                dpi1j[d_] -= mod
    # K = 0 の場合が含まれるので -1
    return((dp[-1][0][0] + dp[-1][1][0] - 1 + mod) % mod)

K = input().rstrip() # 1 <= K <= 10^10000
D = int(input()) # 1 <= D <= 100
print(f2(K, D))


### FIXED CODE ###

# coding: utf-8

import sys
input = sys.stdin.readline

mod = int(1e9 + 7)

def f(K, D):
    l = len(K)
    dp = [[[0] * D for _ in range(2)] for _ in range(l + 1)]
    dp[0][0][0] = 1
    for i in range(l):
        ki = int(K[i])
        for j in range(2):
            uki = 9 if j else ki
            dpij = dp[i][j]
            for d in range(D):
                for k in range(uki + 1):
                    dpij_ = dp[i + 1][j or k < ki]
                    d_ = (d + k) % D
                    dpij_[d_] += dpij[d]
                    dpij_[d_] %= mod
    # K = 0 の場合が含まれるので -1
    return((dp[-1][0][0] + dp[-1][1][0] - 1 + mod) % mod)

K = input().rstrip() # 1 <= K <= 10^10000
D = int(input()) # 1 <= D <= 100

print(f(K, D))
if (a*100+b*10+c)%4==0:
    print('YES')
else:
    print('NO')


### FIXED CODE ###

a,b,c=map(int,input().split())
if (a*100+b*10+c)%4==0:
    print('YES')
else:
    print('NO')
INF = 10 ** 9 + 7
N = int(input())
A = list(map(int, input().split()))
S = [sum(A)]#A[0]~A[N-1]の総和を求める

ans = 0
for i in range(N):
    key = S[-1]#Sの一番後ろの配列をとる(要素は一つしかない)
    S.append(key - A[i])#総和からA[i]を引いてあげたものをS配列に加えてあげるS配列はみぎに行くにつれて値が小さくなる
    #print(S)
    ans += (A[i] * S[-1])#Ansは実際の総和計算に当たるもの

print(ans % INF)

### FIXED CODE ###

D,T,S = map(int, input().split())

A =  D/S

if (A  > T):
    print("No")
else:
    print("Yes")
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(M)]
edges = {}
flag = 'IMPOSSIBLE'
for a, b in AB:
    if a in edges:
        edges[a].append(b)
    else:
        edges[a] = [b]
for i in edges[1]:
    if N in edges[i]:
        flag = 'POSSIBLE'
        break

print(flag)

### FIXED CODE ###

N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(M)]
edges = {}
flag = 'IMPOSSIBLE'
for a, b in AB:
    if a in edges:
        edges[a].append(b)
    else:
        edges[a] = [b]
for i in edges[1]:
    if i not in edges:
        continue
    if N in edges[i]:
        flag = 'POSSIBLE'
        break

print(flag)
n = int(input())
a = n // 1000
b = n // 100 - a * 10
c = n // 10 - a * 100 - b * 10
d = n - a * 1000 - b * 100 - c * 10
yet = True
if a+b+c+d==7 and yet:
    print(str(a)+'+'+str(b)+'+'+str(c)+'+'+str(d)+'=7')
    yet = False
if a+b+c-d==7 and yet:
    print(str(a)+'+'+str(b)+'+'+str(c)+'-'+str(d)+'=7')
    yet = False
if a+b-c+d==7 and yet:
    print(str(a)+'+'+str(b)+'-'+str(c)+'+'+str(d)+'=7')
    yet = False
if a+b-c-d==7 and yet:
    print(str(a)+'+'+str(b)+'-'+str(c)+'-'+str(d)+'=7')
    yet = False
if a-b+c+d==7 and yet:
    print(str(a)+'-'+str(b)+'+'+str(c)+'+'+str(d)+'=7')
    yet = False
if a-b+c-d==7 and yet:
    print(str(a)+'-'+str(b)+'+'+str(c)+'-'+str(d)+'=7')
    yet = False
if a-b-c+d==7 and yet:
    print(str(a)+'-'+str(b)+'-'+str(c)+'+'+str(d)+'=7')
    yet = False
if a-b-c-d==7 and yet:
    print(str(a)+'

### FIXED CODE ###

n = int(input())
a = n // 1000
b = n // 100 - a * 10
c = n // 10 - a * 100 - b * 10
d = n - a * 1000 - b * 100 - c * 10
yet = True
if a+b+c+d==7 and yet:
    print(str(a)+'+'+str(b)+'+'+str(c)+'+'+str(d)+'=7')
    yet = False
if a+b+c-d==7 and yet:
    print(str(a)+'+'+str(b)+'+'+str(c)+'-'+str(d)+'=7')
    yet = False
if a+b-c+d==7 and yet:
    print(str(a)+'+'+str(b)+'-'+str(c)+'+'+str(d)+'=7')
    yet = False
if a+b-c-d==7 and yet:
    print(str(a)+'+'+str(b)+'-'+str(c)+'-'+str(d)+'=7')
    yet = False
if a-b+c+d==7 and yet:
    print(str(a)+'-'+str(b)+'+'+str(c)+'+'+str(d)+'=7')
    yet = False
if a-b+c-d==7 and yet:
    print(str(a)+'-'+str(b)+'+'+str(c)+'-'+str(d)+'=7')
    yet = False
if a-b-c+d==7 and yet:
    print(str(a)+'-'+str(b)+'-'+str(c)+'+'+str(d)+'=7')
    yet = False
if a-b-c-d==7 and yet:
    print(str(a)+'-'+str(b)+'-'+str(c)+'-'+str(d)+'=7')    
    yet = False
A=sorted(list(map(int,input.split())))
print(A[2]-A[0]+1)

### FIXED CODE ###

A=sorted(list(map(int,input().split())))
print(A[2]-A[0])
# -*- coding: utf-8 -*-

import math

k = int(input())

sum = 0
for p in range(k):
    for q in range(k):
        for r in range(k):
            sum += math.gcd(p + 1, q + 1, r + 1)
print(sum)

### FIXED CODE ###

import math
# from functools import reduce

# def gcd(*numbers):
#     return reduce(math.gcd, numbers)

k = int(input())

sum = 0
for p in range(k):
    for q in range(k):
        n = math.gcd(p + 1, q + 1)
        for r in range(k):
            sum += math.gcd(n, r + 1)
print(sum)
from bisect import bisect_left
N = input()
t_list = list ( map ( int, ipnut().split() ) )
t_list.sort()

for i in range ( N - 2 ):
  a = t_list[i]
  for j in range ( i + 1, N - 1 ):
    b = t_list[j]
    c = bisect_left ( t_list , a + b)
    ans += c - j - 1
    
print(ans)


### FIXED CODE ###

from bisect import bisect_left
N = int ( input() )
t_list = list ( map ( int, input().split() ) )
t_list.sort()
ans = 0

for i in range ( N - 2 ):
  a = t_list[i]
  for j in range ( i + 1, N - 1 ):
    b = t_list[j]
    c = bisect_left ( t_list , a + b)
    ans += c - j - 1
    
print(ans)
k = int(input())

if k %2 == 0:
  print(int(k*k/2/2)




else:
  print(int((k/2)*(k//2)/2)

### FIXED CODE ###

k = int(input())
if k %2 == 0:
  print(int(k*k/2/2))
elif k%2 ==1:
  print(int((k//2 + 1)*(k//2)))
n = input()
S = input().split()
q = input()
T = input().split()

print(len(S&T)

### FIXED CODE ###

n = int(input())
S = input().split()
q = int(input())
T = input().split()

#print(len(S&T))
#set:???????????????????????????

cnt = 0

for i in range(len(T)):
    left = 0
    right = n
    while left < right:
        mid = (left+right) // 2
        if int(S[mid]) == int(T[i]):
            cnt += 1
            break
        elif int(S[mid]) < int(T[i]):
            left = mid+1
        else:
            right = mid
print(cnt)
S=input();
s=[];
x=[];
X=[];
so=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,83,89,97,101,107,109,113,127,131,137,139,149,151,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,809,811,821,823,827,829,839,853,857,859,863,877,881,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];
ans=1;
for h in range(S):
    Y=h+1;
    for i in so:
        j=0;
        while Y%i==0:
            Y=Y/i;
            s=s+[i];
            j+=1;
for i in so:
    x=x+[s.count(i)];
X=[X+1 for X in x];
print(X);
for i in X:
    ans=ans*i;
print(ans%1000000007);

### FIXED CODE ###

S=int(input());
s=[];
x=[];
X=[];
so=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];
ans=1;
for h in range(S):
    Y=h+1;
    for i in so:
        j=0;
        while Y%i==0:
            Y=Y/i;
            s=s+[i];
            j+=1;
for i in so:
    x=x+[s.count(i)];
X=[X+1 for X in x];
for i in X:
    ans=ans*i;
print(ans%1000000007);
(a, b)  = list(map(int, input().split())
print (a*b, 2(a+b))

### FIXED CODE ###

a, b =list(map(int, input().split()))
print (a*b, 2*(a+b))
x=list(map(int,input().split()))

for i in range(len(x)):
  if x[i]==0:
    print(i+1)
    break:

### FIXED CODE ###

x=list(map(int,input().split()))
 
for i in range(len(x)):
    if x[i]==0:
        print(i+1)
        break
import math

n = int(raw_input())

for i in range(n):

  x1, y1, x2, y2, x3, y3 = map(int, raw_input().split())

  px = ((y2 - y3)*(x1*x1 + y1*y1) + (y3 - y1)*(x2*x2 + y2*y2) + (y1 - y2)*(x3*x3 + y3*y3))/(2*(x1*(y2 - y3) + x2*(y3 - y1) + x3*(y1 - y2)))
  py = ((x2 - x3)*(x1*x1 + y1*y1) + (x3 - x1)*(x2*x2 + y2*y2) + (x1 - x2)*(x3*x3 + y3*y3))/(2*(y1*(x2 - x3) + y2*(x3 - x1) + y3*(x1 - x2)))

  r = math.sqrt(pow((x1 - px), 2) + pow((y1 - py), 2))

  print "%.4f %.4f %.4f" % (px, py, r)

### FIXED CODE ###

import math

n = int(raw_input())

for i in range(n):

  x1, y1, x2, y2, x3, y3 = map(float, raw_input().split())

  px = ((y2 - y3)*(x1*x1 + y1*y1) + (y3 - y1)*(x2*x2 + y2*y2) + (y1 - y2)*(x3*x3 + y3*y3))/(2*(x1*(y2 - y3) + x2*(y3 - y1) + x3*(y1 - y2)))
  py = ((x2 - x3)*(x1*x1 + y1*y1) + (x3 - x1)*(x2*x2 + y2*y2) + (x1 - x2)*(x3*x3 + y3*y3))/(2*(y1*(x2 - x3) + y2*(x3 - x1) + y3*(x1 - x2)))

  r = math.sqrt(pow((x1 - px), 2) + pow((y1 - py), 2))

  print "%.3f %.3f %.3f" % (px, py, r)
def solve(i, m):
  if m == 0:
    return 1
  if i >= n:
    return 0
  res = solve(i+1, m) or solve(i+1, m-A[i])
  return res


n = input()
A = map(int, raw_input().split())
p = input()
m = map(int, raw_input().split())
for i in range(q)
  if solve(0, m[q]):
    print 'yes'
  else:
    print 'no'

### FIXED CODE ###

def solve(i, m):
  if dp[i][m] != -1:
    return dp[i][m]

  if m == 0:
    dp[i][m] = 1
  elif i >= n:
    dp[i][m] = 0
  elif solve(i+1, m):
    dp[i][m] = 1
  elif solve(i+1, m-A[i]):
    dp[i][m] = 1
  else:
    dp[i][m] = 0

  return dp[i][m]



n = input()
A = map(int, raw_input().split())
p = input()
m = map(int, raw_input().split())

dp = [[-1 for col in range(2000)] for row in range(n+1)]

for i in range(p):
  if solve(0, m[i]):
    print 'yes'
  else:
    print 'no'
S = input()
T = input()
print(S + T)

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
S,T = read().decode('utf-8').split()
 
answer = T + S
print(answer)
words = input()
key = input()
for i in range(len(words)):
    if words[i:i+len(key)] == key:
         words[i:i+len(key)] = key
         print(words.replace('?', 'a'))
else:
    print('UNRESTORABLE')

### FIXED CODE ###

r = int(input())
g = int(input())

print(g*2-r)
n = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
 
print(n[k-1])


### FIXED CODE ###

number = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
 
print(number[int(input())-1])
n = int(input())
a = list(map(int,input().split()))
if n == 1:
    print(a[0])
else:
    print(*a[::-2],*a[::2])


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
if n == 1:
    print(a[0])
else:
    print(*a[::-2],end = ' ')
    print(*a[n%2::2])
A = []
[A.extend(map(int, input().split())) for _ in range(3)]
_, *B = map(int, open(0).read().split())
for b in B:
    try:
        i = A.index(b)
        A[i] = 0
    except:
        pass
lines = [
    [0, 1, 2],
    [3, 4, 5],
    [6, 7, 8],
    [0, 3, 6],
    [1, 4, 7],
    [2, 5, 8],
    [0, 4, 8],
    [2, 4, 6],
]
ans = "No"
for line in lines:
    a, b, c = line
    if A[a] == 0 and A[a] == A[b] and A[a] == A[c]:
        ans = "Yes"
print(ans)


### FIXED CODE ###

A = []
[A.extend(map(int, input().split())) for _ in range(3)]
N = int(input())
B = [int(input()) for _ in range(N)]
for b in B:
    try:
        i = A.index(b)
        A[i] = 0
    except:
        pass
lines = [
    [0, 1, 2],
    [3, 4, 5],
    [6, 7, 8],
    [0, 3, 6],
    [1, 4, 7],
    [2, 5, 8],
    [0, 4, 8],
    [2, 4, 6],
]
ans = "No"
for line in lines:
    a, b, c = line
    if A[a] == 0 and A[a] == A[b] and A[a] == A[c]:
        ans = "Yes"
print(ans)
import sys
import copy
from collections import deque

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


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


def main():
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()

    if A[0] >= 0:
        ans = sum(A[1:]) - A[0]
        plus = copy.deepcopy(A[1:])
        minus = [A[0]]
    elif A[-1] <= 0:
        ans = -sum(A[:-1]) + A[-1]
        plus = [A[-1]]
        minus = copy.deepcopy(A[:-1])
    else:
        plus = []
        minus = []
        ans = 0
        for a in A:
            if a >= 0:
                ans += a
                plus.append(a)
            else:
                ans -= a
                minus.append(a)

    plus = deque(plus)
    minus = deque(minus)
    print(ans)

    # minusをまず一つにする
    while len(minus) > 1:
        p = plus.pop()
        m = minus.pop()
        print(p, m)
        plus.append(p - m)

    # minusが1つになったあとの処理
    p = plus.pop()
    m = minus.pop()
    print(m, p)
    cur = m - p
    while len(plus) > 1:
        p = plus.pop()
        print(cur, p)
        cur -= p
    p = plus.pop()
    print(p, cur)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
import copy
from collections import deque

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


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


def main():
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()

    if A[0] >= 0:
        ans = sum(A[1:]) - A[0]
        plus = copy.deepcopy(A[1:])
        minus = [A[0]]
    elif A[-1] <= 0:
        ans = -sum(A[:-1]) + A[-1]
        plus = [A[-1]]
        minus = copy.deepcopy(A[:-1])
    else:
        plus = []
        minus = []
        ans = 0
        for a in A:
            if a >= 0:
                ans += a
                plus.append(a)
            else:
                ans -= a
                minus.append(a)

    plus = deque(plus)
    minus = deque(minus)
    print(ans)

    # minusをまず一つにする
    while len(minus) > 1:
        p = plus.pop()
        m = minus.pop()
        print(p, m)
        plus.append(p - m)

    # minusが1つになったあとの処理
    p = plus.pop()
    m = minus.pop()
    if len(plus) == 0:
        print(p, m)
        return

    print(m, p)
    cur = m - p
    while len(plus) > 1:
        p = plus.pop()
        print(cur, p)
        cur -= p
    if len(plus) != 0:
        p = plus.pop()
        print(p, cur)


if __name__ == "__main__":
    main()
a,b = map(int,input().split())
count = 0
for i in range(a,b+1):
  l = list(i)
  if l == l[::-1]:
    count += 1
print(count)

### FIXED CODE ###

a,b = map(int,input().split())
count = 0
for i in range(a,b+1):
  l = list(str(i))
  if l == l[::-1]:
    count += 1
print(count)