Harryxun/stf_run huggingface dataset:
# your code goes here
#polland
def nu(x):
    if x=="+" or x=="-" or x=="*":
        return 0
    else:
        return 1
def c(a,b,l):
    if l=="+":
        d=a+b
    elif l=="-":
        d=a-b
    else:
        d=a*b
    return d
F=[i for i in input().split()]
i=0
S=[]
while i<len(F):
    if nu(F[i])==0:
        S[-2]=c(S[-2],S[-1],F[i])
        S.pop(-1)
        i+=1
    else:
        F[i]=int(F[i])
        if nu(F[i+1])==0:
            S[-1]=c(S[-1],F[i],F[i+1])
            i+=2
        else:
            F[i+1]=int(F[i+1])
            S.append(c(F[i],F[i+1],F[i+2]))
            i+=3
print(S[0])

### FIXED CODE ###

# your code goes here
#polland
def nu(x):
    if x=="+" or x=="-" or x=="*":
        return 0
    else:
        return 1
def c(a,b,l):
    if l=="+":
        d=a+b
    elif l=="-":
        d=a-b
    else:
        d=a*b
    return d
F=[i for i in input().split()]
i=0
S=[]
while i<len(F):
    if nu(F[i])==0:
        S[-2]=c(S[-2],S[-1],F[i])
        S.pop(-1)
    else:
        S.append(int(F[i]))
    i+=1
print(S[0])
n,a,b = map(int,input().split())
    mod = 10**9+7
     
    from math import factorial
    cmb_a = factorial(n) / factorial(a) / factorial(n-a)
    cmb_b = factorial(n) / factorial(b) / factorial(n-b)
     
    print(int((2**n - 1 - cmb_a - cmb_b) % mod))

### FIXED CODE ###

def cmb(n, r):
	if n - r < r:
		r = n - r
	if r == 0:
		return 1
	if r == 1:
		return n
	
	num = [n - r + k + 1 for k in range(r)] #numerator(分子)
	den = [k + 1 for k in range(r)] #denominator(分母)
	
	for p in range(2, r + 1):
		pivot = den[p - 1]
		if pivot > 1:
			offset = (n - r) % p
			for k in range(p - 1, r, p):
				num[k - offset] /= pivot
				den[k] /= pivot
	
	result = 1
	for k in range(r):
		if num[k] > 1:
			result *= int(num[k])
			result = result % mod
	
	return result

n,a,b = map(int,input().split())
mod = 10**9+7

print((pow(2,n,mod) - 1 - cmb(n,a) - cmb(n,b)) % mod)
a = int(input())

if a == 1:
  print("Hello World")
else:
  print(int(input()+int(input())))

### FIXED CODE ###

a = int(input())

if a == 1:
  print("Hello World")
else:
  print(int(input())+int(input()))
import sys
def I_dont_know_what_to_do():
    a = long(input())
    b = long(input())
    c = int(input())

    if a < b:
        n = a
        a = b
        b = n

    s = (a - b + 2 - a % c - b % c) / c
    print(s)


I_dont_know_what_to_do()

### FIXED CODE ###

def main():
    
    end, start, divisor = [int(i) for i in input().split()]
    a = start//divisor - (end-1)//divisor

    print(a)

main()
ddimport sys
INF = float("inf")


def solve(N: int, M: int, s: "List[int]", c: "List[int]"):

    for i in range(1000):
        A = str(i)
        if len(A) != N:
            continue
        flag = True
        for ss, cc in zip(s, c):
            if int(A[ss-1]) != cc:
                flag = False
                break

        if flag == True:
            print(A)
            return
    print(-1)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    s = [int()] * (M)  # type: "List[int]"
    c = [int()] * (M)  # type: "List[int]"
    for i in range(M):
        s[i] = int(next(tokens))
        c[i] = int(next(tokens))
    solve(N, M, s, c)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
INF = float("inf")


def solve(N: int, M: int, s: "List[int]", c: "List[int]"):

    for i in range(1000):
        A = str(i)
        if len(A) != N:
            continue
        flag = True
        for ss, cc in zip(s, c):
            if int(A[ss-1]) != cc:
                flag = False
                break

        if flag == True:
            print(A)
            return
    print(-1)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    s = [int()] * (M)  # type: "List[int]"
    c = [int()] * (M)  # type: "List[int]"
    for i in range(M):
        s[i] = int(next(tokens))
        c[i] = int(next(tokens))
    solve(N, M, s, c)


if __name__ == '__main__':
    main()
#!/usr/bin/env python3
import sys
import fractions
import math


def solve(N: int, A: "List[int]"):
    L = []
    last = A[0]
    for i in range(N):
        last = math.gcd(last, A[i])
        L.append(last)
    last = A[-1]
    R = []
    for i in range(1, N+1):
        last = math.gcd(last, A[-i])
        R.append(last)
    R.reverse()
    maxGCD = max(L[-2], R[-2])
    for i in range(1, N-1):
        maxGCD = max(math.gcd(L[i-1], R[i+1]), maxGCD)
    print(maxGCD)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import fractions
import math


def solve(N: int, A: "List[int]"):
    L = []
    last = A[0]
    for i in range(N):
        last = fractions.gcd(last, A[i])
        L.append(last)
    last = A[-1]
    R = []
    for i in range(1, N+1):
        last = fractions.gcd(last, A[-i])
        R.append(last)
    R.reverse()
    if N == 2:
        print(max(A[0], A[1]))
        return
    maxGCD = max(L[-2], R[1])
    for i in range(1, N-1):
        maxGCD = max(fractions.gcd(L[i-1], R[i+1]), maxGCD)
    print(maxGCD)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)


if __name__ == '__main__':
    main()
def main(S, T):
    cs = dict()

    for i, s in enumerate(S):
        t = T[i]
        if s != t:
            if t not in cs:
                cs[t] = s
            elif cs[t] == s:
                continue
            else:
                return "No"
    return "Yes"

if __name__ == "__main__":
    #assert main("azzel", "apple") == "Yes"
    #assert main("abcdefghijklmnopqrstuvwxyz", "ibyhqfrekavclxjstdwgpzmonu") == "Yes"
    #assert main("chokudai", "redcoder") == "No"
    S = input()
    T = input()
    print(main())


### FIXED CODE ###

import sys
import collections

def main(S, T):
    print(S, file=sys.stderr)
    print(T, file=sys.stderr)

    m = dict()
    for s, t in zip(S, T):
        if s in m and m[s] != t:
            return "No"
        m[s] = t
    print("  ".join(m), file=sys.stderr)
    print("  ".join(m.values()), file=sys.stderr)
    c = set()
    for t in m.values():
        if t in c:
            return "No"
        c.add(t)
    return "Yes" 

assert main("chokudai", "redcoder") == "No"
assert main("azzel", "apple") == "Yes"
assert main("abcdefghijklmnopqrstuvwxyz", "ibyhqfrekavclxjstdwgpzmonu") == "Yes"
S = input()
T = input()
print(main(S, T))
a,b = map(int, input(), split())
if a%2 == 1:
  print("Odd")
else print ("Even")

### FIXED CODE ###

a,b = map(int, input().split())
# if a%2 == 1:
#  print("Odd")
# else :
# print ("Even")
print('Odd' if a*b%2 == 1 else 'Even')
s = input()
a =['SUN','MON','TUS','WED','THU','FRI','SAT']
if a!= 'SUN':
	print(a.index(s))
else:
  print(7)

### FIXED CODE ###

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

print(7-a.index(s))
a,b = (int(x) for x in input().split())

d = a // b
r = a % b
(float) f = (float)a / (float)b

print (str(d) + " " + str(r) + " " + str(f))



### FIXED CODE ###

a,b = (int(x) for x in input().split())

d = a // b
r = a % b
f = float(a) / float(b)

print ("{0} {1} {2:.8f}".format(d,r,f))
s=input()
n=len(s)
t=int(input())
if t==1:
    print(s)
    exit()
ans=set()
for l in range(n-1):
    for r in range(l+1,n+1):
        ans.add(s[l:r])
aa=list(ans)
aa.sort()
print(aa[t-1])

### FIXED CODE ###

s = input()
l = len(s)
k = int(input())
A = set()
for i in range(l):
    for j in range(1, 6):
        if i+j <= l:
            A.add(s[i:i+j])
ANS = sorted(A)
print(ANS[k-1])
n = int(input())
a = sorted(list(map(int, input().split())))


mid_dis = [abs(a[n-1] / 2 - a[i]) for i in range(n-1)]
arg_max_i = [i for i in range(n-1) if mid_dis[i] == min(mid_dis)][0]

print(a[n-1], a[arg_max_i])

### FIXED CODE ###

A, B, X = map(int, input().split())

if (A <= X) and (X <= A+B):
  res = "YES"
else:
  res = "NO"

print(res)
from math import gcd

a, b = map(int, input().split())
data = []
for i in range(1, int(min(a, b) ** 0.5) + 1):
    if a % i == 0 and b % i == 0:
        data.append(i)
        if b % (a // i) == 0:
            data.append(a // i)
        if a % (b // i) == 0:
            data.append(b // i)
data = list(set(data)).sort()
for i in range(len(data)):
    j = i + 1
    while j < len(data):
        if gcd(data[i], data[j]) != 1:
            del data[j]
        else:
            j += 1
print(len(data))

### FIXED CODE ###

from math import gcd
from copy import copy
a, b = map(int, input().split())

def div(x):
    ret = []
    for i in range(1, int(x ** 0.5) + 1):
        if x % i == 0:
            ret.append(i)
            ret.append(x // i)
    
    return ret

def judge_prime(x):
    cnt = 0
    for i in range(1, int(x ** 0.5) + 1):
        if x % i == 0:
            cnt += 1
        if cnt >= 2:
            return False
    return True

div_a = div(a)
div_b = div(b)

data = list(set(div_a) & set(div_b))

ans = 0
for x in data:
    if judge_prime(x):
        ans += 1
print(ans)
s = input()
q = int(input())

li = [input() for i in range(q)]

k= 0

for i in range(q):
    if li[0] == 1:
        k += 1
    else:
        li3 = li[i].split()
        if (int(li3[1])+k) % 2 == 0:
            s = s + li3[2]
        else:
            s = li3[2] + s

if k % 2 == 0:
    print(s)
else:
    print(s[::-1])

### FIXED CODE ###

from collections import deque
s = input()
q = int(input())

li = [input() for i in range(q)]
k = 0
ans = [s]
ans = deque(ans)

for i in li:
    if i == "1":
        k += 1
    else:
        if (int(i[2]) + k) % 2 == 0:
            ans.append(i[4])
        else:
            ans.appendleft(i[4])

ans = list(ans)
s = "".join(ans)
if k % 2 == 0:
    print(s)
else:
    print(s[::-1])
import sys
input = sys.stdin.readline

n, k = map(int, input().split())
parr = list(map(int, input().split()))
carr = list(map(int, input().split()))

dp = [[0]*n for _ in range(k+1)]
maximum = -10**9

for i in range(1, k+1):
    for j in range(n):
      tmp = dp[i-1][j] + carr[j]
      dp[i][parr[j]-1] = tmp
      if tmp > maximum:
        maximum = tmp

print(int(maximum))

### FIXED CODE ###

import sys
input = sys.stdin.readline

n, k = map(int, input().split())
parr = list(map(int, input().split()))
carr = list(map(int, input().split()))
scores = []

for i in range(n):
  cur = i
  # 1ループで通るノードの数とスコア
  roop_num = 0
  roop_score = 0
  while True:
    cur = parr[cur] - 1
    roop_num += 1
    roop_score += carr[cur]
    if cur == i:
      break
  tmp_max = -10**9
  # ループしたときにスコアが減るとき
  # kが1ループの回数より小さいとき
  if roop_score <= 0:
    score = 0
    max_iter = roop_num
  elif k <= roop_num:
    score = 0
    max_iter = k
  else:
    # ループする回数
    num = k // roop_num - 1
    score = roop_score*num
    max_iter = k - roop_num*num
  cur = i
  for _ in range(max_iter):
      cur = parr[cur] - 1
      score += carr[cur]
      if score > tmp_max:
        tmp_max = score
  scores += [tmp_max]

print(max(scores))
dat =list(input().split())

for i in dat:
	i = int(i)

dat.sort()
dat.reverse()

asum = 0
bsum = 0
sum=0

for i in range(len(dat)):
     sum = sum + dat[i]
		
print(sum)

### FIXED CODE ###

n = int(input())
dat = list(input().split())

dat = list(map(int,dat))

dat.sort(reverse=True)

asum = 0
bsum = 0

for i in range(n):
	if i % 2 == 0:
		asum = asum + dat[i]
	else:
		bsum = bsum + dat[i]
		
print(asum-bsum)
li = list(input())

for i in range(len(li)):
    if i % 2 == 0:
        if len[i] = "R":
            print("No")
            quit()
    else:
        if len[i] = "L":
            print("No")
            quit()
print("Yes")


### FIXED CODE ###

li = list(input())

for i in range(len(li)):
    if i % 2 == 1:
        if li[i] == "R":
            print("No")
            quit()
        else:
            continue
    else:
        if li[i] == "L":
            print("No")
            quit()
        else:
            continue
print("Yes")
a=int(input())
s=input()
for i in range(a):
  d=List[i]+a
  if d>=91:
    d-=26
  print(d,end="")

### FIXED CODE ###

a=int(input())
s=input()
for i in range(len(s)):
  d=ord(s[i])+a
  if d>=91:
    d-=26
  print(chr(d),end="")
N = int(input())
a = list(map(int, input()split()))
c = 0
for i in range(N):
	if a[a[i] - 1] == i + 1:
		c += 1

print(int(c / 2))

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
c = 0
for i in range(N):
	if a[a[i] - 1] == i + 1:
		c += 1

print(int(c / 2))
N, K = map(int, input().split())
d = list(map(int, input().split()))
left = [0]
left_m = []
right = [0]
right_m = []
for i, l, r in zip(range(K), d, d[::-1]):
    left.append(left[i] + l)
    left_m.append(l if l < 0 else 0)
    right.append(right[i] + r)
    right_m.append(r if r < 0 else 0)
point = 0
for i in range(K):
    for j in range(K - i):
        p = K - i - j
        minus = list(sorted(left_m[:i] + right_m[:j]))
        point = max(point, left[i] + right[j] - sum(minus[:p]))
print(point)


### FIXED CODE ###

a, p = map(int, input().split())
print((a * 3 + p) // 2)
N = int(input())
X1 = list(map(int, input().split()))
ans = []
if N == 1:
    print(0)
    exit()
    
for p in range(min(X1), max(X1)):
    num = 0
    for i in range(N):
        num += (X1[i] - p)*(X1[i] - p)
        
    ans.append(int(num))


print(min(ans))

### FIXED CODE ###

N = int(input())
X1 = list(map(int, input().split()))
ans = []
if N == 1:
    print(0)
    exit()
    
if min(X1) == max(X1):
    print(0)
    exit()
    
for p in range(min(X1), max(X1)):
    num = 0
    for i in range(N):
        num += (X1[i] - p)*(X1[i] - p)
        
    ans.append(int(num))

print(min(ans))
x = raw_input().split(" ")
a = x[0]
b = x[1]
print a * b, 2*(a + b)

### FIXED CODE ###

x = raw_input().split(" ")
a = int(x[0])
b = int(x[1])
print a * b, 2*(a + b)
S = input()
K = int(input())

con = 0

for i in range(0,len(S)):
  if S[i] == "1":
    con += 1
  else:break
    

if K < con:
  print(1)
else:
  if S[0] == "1":
    print(int(S[1]))
  else:
    print(int(S[0]))

### FIXED CODE ###

S = input()
K = int(input())

con = 0

for i in range(0,len(S)):
  if S[i] == "1":
    con += 1
  else:break

if K <= con:
  print(1)
else:
  if S[0] == "1":
    S = S.replace("1","")
    print(int(S[0]))
  else:
    print(int(S[0]))
A = int(input())
B = int(input())
if (A < 9) and (B < 9):
    print('Yay!')
else:
    print(':(')


### FIXED CODE ###

A, B = map(int, input().split())
if A <= 8 and B <= 8:
    print('Yay!')
else:
    print(':(')
# Atcoder ABC 157
# Problem B

a = []
 for i in range(3):
  a.append(list(map(int, input().split())))

n = int(input())

for _ in range(n):  #b_n roop
   b = int(input())
   for i in range(3):
    for j in range(3):
      if b == a[i][j]:
        a[i][j] = 0  #make a 0
        
for i in range(3):
    if sum(a[i]) == 0: #横チェック
     print("Yes")
     exit()
    if sum([a[0][i], a[1][i], a[2][i]]) == 0: #縦チェック
     print("Yes")
     exit()

if sum([a[0][0], a[1][1], a[2][2]]) == 0: #斜めチェック
    print("Yes")
    exit()

if sum([a[2][0], a[1][1], a[0][2]]) == 0: #逆斜めチェック
    print("Yes")
    exit()

#n(Yes)=0のとき

### FIXED CODE ###

# Atcoder ABC 157
# Problem B

a = []
for i in range(3):
  a.append(list(map(int, input().split())))

n = int(input())

for _ in range(n):  #b_n roop
   b = int(input())
   for i in range(3):
    for j in range(3):
      if b == a[i][j]:
        a[i][j] = 0  #make a 0
        
for i in range(3):
    bingo = False
    if sum(a[i]) == 0: #横チェック
     print("Yes")
     exit()
    if sum([a[0][i], a[1][i], a[2][i]]) == 0: #縦チェック
     print("Yes")
     exit()

if sum([a[0][0], a[1][1], a[2][2]]) == 0: #斜めチェック
    print("Yes")
    exit()

if sum([a[2][0], a[1][1], a[0][2]]) == 0: #逆斜めチェック
    print("Yes")
    exit()

#n(Yes)=0のとき
print("No")
#coding:utf-8

a = int(input())
while i*i <= a:
  i=i+1

i=i-1

print(i*i)

### FIXED CODE ###

#coding:utf-8

a = int(input())
i=0
while i*i <= a:
  i=i+1

i=i-1

print(i*i)
n, u, v = map(int, input().split())
u, v = u-1, v-1
edges = [[] for i in range(n)]
for i in range(n-1):
    ai, bi = map(int, input().split())
    ai, bi = ai-1, bi-1
    edges[ai].append(bi)
    edges[bi].append(ai)

def dfs(already, node, depth):
    depth += 1
    children = edges[node]
    for child in children:
        if already[child] == 0:
            already[child] = depth
            already = dfs(already, child, depth)
    return already

already_u = [0 for i in range(n)]
already_u = dfs(already_u, u, 0)
already_u[u] = 0
already_v = [0 for i in range(n)]
already_v = dfs(already_v, v, 0)
already_v[v] = 0

maxi = 0
for i in range(n):
    if already_u[i] < already_v[i]:
        maxi = max(maxi, already_v[i])
print(maxi-1)

### FIXED CODE ###

n, u, v = map(int, input().split())
u, v = u-1, v-1
edges = [[] for i in range(n)]
for i in range(n-1):
    ai, bi = map(int, input().split())
    ai, bi = ai-1, bi-1
    edges[ai].append(bi)
    edges[bi].append(ai)

depth = 0
already = [0 for i in range(n)]
already[v] = 1
nodes = [v]
while nodes != []:
    depth += 1
    next_nodes = []
    for node in nodes:
        children = edges[node]
        for child in children:
            if already[child] == 0:
                already[child] = depth
                next_nodes.append(child)
    nodes = next_nodes
already[v] = 0

depth = 0
already_u = [0 for i in range(n)]
already_u[u] = 1
nodes = [u]
while nodes != []:
    depth += 1
    next_nodes = []
    for node in nodes:
        children = edges[node]
        for child in children:
            if already_u[child] == 0:
                already_u[child] = depth
                next_nodes.append(child)
    nodes = next_nodes
already_u[u] = 0

maxi = 0
for i in range(n):
    if already_u[i] < already[i]:
        maxi = max(maxi, already[i])

print(maxi-1)
import math




N=int(input())

anslist=[0]*(N+1)
ma=int(math.sqrt(N/2))+1
for x in range(1,ma):
    for y in range(x,ma):
        for z in range(y,ma):
            n=x**2+y**2+z**2+x*y+y*z+z*x
            if x==y and y==z:
                anslist[n+1]+=1
            elif x==y or y==z or z==x:
                anslist[n+1]+=3
            else:
                anslist[n+1]+=6

            

for i in range(1,N+1):
    print(anslist[i])

### FIXED CODE ###

import math




N=int(input())

anslist=[0]*(N+1)
ma=int(math.sqrt(N))+1
for x in range(1,ma):
    for y in range(x,ma):
        for z in range(y,ma):
            n=x**2+y**2+z**2+x*y+y*z+z*x
            if n <=N:
                if x==y and y==z:
                    anslist[n]+=1
                elif x==y or y==z or z==x:
                    anslist[n]+=3
                else:
                    anslist[n]+=6

            
for i in range(1,N+1):
    print(anslist[i])
input_ = input()

input_str = set(input_)

input_str_arr = [s for s in input_str]

if len(set(input_str_arr))==2:
    consunt()
else:
    print("No")
    

def consunt():
    if input_.count(input_str_arr[0]) and input_.count(input_str_arr[1]):
      print("Yes")
    else:
      print("No")

### FIXED CODE ###

def consunt():
    if input_.count(input_str_arr[0]) and input_.count(input_str_arr[1]):
      print("Yes")
    else:
      print("No")

input_ = input()

input_str = set(input_)

input_str_arr = [s for s in input_str]

if len(set(input_str_arr))==2:
    consunt()
else:
    print("No")
n = int(input())
A = list(map(int, input().split()))

dp = [[0 for i in range((n//2)+1)] for j in range(n)]

M = - float('inf')
for i in range(4):
    M = max(M, A[i])
    dp[i][0] = M
dp[2][1] = dp[0][0] + A[2]
dp[3][1] = max(dp[1][0] + A[3], dp[2][1])


# for i in range(len(dp)):
#     print(dp[i])

for i in range(4, n):
    for j in range(max(0, i // 2 - 1), (i + 2) // 2):
        # print(i, j)
        if i % 2 == 0:
            dp[i][j] = dp[i-2][j-1] + A[i]
        else:
            dp[i][j] = max(dp[i-2][j-1] + A[i], dp[i-1][j])

# for i in range(len(dp)):
#     print(dp[i])

print(dp[n-1][n//2-1])

### FIXED CODE ###

import sys

n = int(input())
A = [int(_) for _ in input().split()]

# dp = [[0 for i in range((n//2)+1)] for j in range(n)]

if n == 1 or n == 2 or n == 3:
    print(max(A))
    sys.exit()

dp = [[0, 0] for j in range(n)]
M = - float('inf')
for i in range(4):
    M = max(M, A[i])
    dp[i][0] = M
dp[2][1] = dp[0][0] + A[2]
dp[3][1] = max(dp[1][0] + A[3], dp[2][1])


# for i in range(len(dp)):
#     print(dp[i])

# for i in range(4, n):
#     for j in range(max(0, i // 2 - 1), (i + 2) // 2):
#         # print(i, j)
#         if i % 2 == 0 and j == (i + 2) // 2 - 1 :
#             dp[i][j] = dp[i-2][j-1] + A[i]
#         else:
            # dp[i][j] = max(dp[i-2][j-1] + A[i], dp[i-1][j])

for i in range(4, n):
    for j in range(2):
        # print(i, j)
        if i % 2 == 0 and j == 1:
            dp[i][j] = dp[i-2][1] + A[i]
        elif i % 2 == 0 and j == 0:
            dp[i][j] = max(dp[i-2][0] + A[i], dp[i-1][1])
        elif i % 2 == 1 and j == 1:
            dp[i][j] = max(dp[i-2][1] + A[i], dp[i-1][1])
        else:
            dp[i][j] = max(dp[i-2][0] + A[i], dp[i-1][0])

# for i in range(len(dp)):
#     print(dp[i])

print(dp[n-1][(n+1)%2])
S = input()
ACGT = ["A", "C", "G", "T"]
count = 0
mx = 0
if S[0] in ACGT:
    count += 1
if len(S) >= 2:
    for i in range(len(S)-1):
        if S[i] in ACGT and S[i+1] in ACGT:
            count += 1
        else:
            ans = max(mx, count)
            count = 0
            mx = ans
print(ans)

### FIXED CODE ###

S = input()
ACGT = ["A", "C", "G", "T"]
K = []
for i in range(len(S)):
    if S[i] in ACGT:
        K.append(i)
if len(K) == 0:
    ans = 0
elif len(K) == 1:
    ans = 1
else:
    count = 0
    mx = 0
    for j in range(len(K)-1):
        if K[j+1]-K[j] == 1:
            count += 2
        else:
            ans = max(count, mx)
            count = 0
            mx = ans
    ans = max(count, mx)
    ans = ans/2 + 1
print(int(ans))
def main():
  list_s = [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]
  k = int(input())
  
  print(list_s[k+1])
  
main()

### FIXED CODE ###

K = int(input())
k = [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(k[K-1])
a = input()
b = input()

c = (a+b)/2

print(c.round())

### FIXED CODE ###

S=((input())).split(' ')
print((int)(((int)(S[0])+(int)(S[1]))/2+0.5))
n, k = map(int, input().split())
a = list(map(int, input().split()))
b = [0]*n
for i in range(n):
    b[a[i]] += 1
c = [i for i in b if i != 0]
c.sort()
if len(c) - k > 0:
    print(sum((c[0:len(c)-k])))
else:
    print(0)

### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
b = [0]*n
for i in range(n):
    b[a[i]-1] += 1
c = [i for i in b if i != 0]
c.sort()
if len(c) - k > 0:
    print(sum((c[0:len(c)-k])))
else:
    print(0)
m1,d1 = map(int,input().split)
m2,d2 = map(int,input().split)
if d2 == 1:
	print(1)
else:
	print(0)

### FIXED CODE ###

m,d = map(int,input().split())
mm,dd = map(int,input().split())
if dd == 1:
	print(1)
else:
	print(0)
n=int(input())
s=list(str(n))
t=0
for i in range(len(s)):
  t+=int(s[i])
if n%s==0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n=int(input())
s=list(str(n))
t=0
for i in range(len(s)):
  t+=int(s[i])
if n%t==0:
  print('Yes')
else:
  print('No')