peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import sys

ri = lambda: int(sys.stdin.readline())

n = ri()
print('YES' if n == 3 or n == 5 or n == 7 else 'NO')
# Judge status: Wrong Answer
n = int(input())
number = input().split(" ")
ans = 0
for i in range(n-2):
    if number[i] > number[i+1] and number[i+1] > number[i+2]:
        ans += 1
    elif number[i] < number[i+1] and number[i+1] < number[i+2]:
        ans += 1
    else:
        pass
print(ans)
# Judge status: Wrong Answer
n=int(input())
p=1
for i in range(1,n+1):
    p=p*i
    p=p%(10**9+7)
# Judge status: Wrong Answer
D=list(map(int, input().split()))
D=sorted(D)
print(D[len(D)//2]-D[len(D)//2-1])
# Judge status: Wrong Answer
s=input()
q=int(input())
count=0
while(q):
    q-=1
    t=list(input().split())
    if t[0]=='2':
        f=t[1]
        c=t[2]
        if f=='1':
            s=c+s
        else:
            s=s+c
    else:
        count+=1
if count%2==1:
    s=s[::-1]
print(s)
# Judge status: Accepted
# ABC094c
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n = int(input())
x = list(map(int, input().split()))
for i in range(n):
    x[i] = (x[i], i)
x.sort()

ans = [-1]*n

ind = n//2
for i in range(n):
    if i <= n//2-1:
        ans[x[i][1]] = x[n//2][0]
    else:
        ans[x[i][1]] = x[n//2-1][0]
print(*ans, sep='\n')
# Judge status: Accepted
S = input()
N = len(S)
ans = [0] * (N + 1)
for i in range(N):
    if S[i] == "<":
        ans[i + 1] = ans[i] + 1
for i in range(N - 1, -1, -1):
    if S[i] == ">":
        if ans[i] <= ans[i + 1]:
            ans[i] = ans[i + 1] + 1
print(sum(ans))
# Judge status: Accepted
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import Counter


def main():
    N, M = map(int, input().split())
    A, K = [], []
    lst = [list(map(int, input().split())) for _ in range(N)]
    for l in lst:
        A.append(l[0])
        if type(l[1:]) is list:
            K.extend(l[1:])
        else:
            K.append(l[1:])
    print(sum([1 for c in Counter(K).values() if c == len(A)]))


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
A,B=map(int,input().split())
if A==B:
  print('Draw')
elif A < B or B==1:
  print('Bob')
else:
  print('Alice')
# Judge status: Accepted
N, A, B = map(int, input().split())
ans = 0

for i in range(1,N+1):
  i_str = str(i)
  i_len = len(i_str)
  sum = 0
  for j in range(i_len):
    sum += int(i_str[j])
  if sum >= A and sum <= B:
    ans += i
    
print(ans)
# Judge status: Accepted
from collections import Counter
input()
cnt=Counter(input())

ans=1
mod=10**9+7

for v in cnt.values():
    ans*=v+1
    ans%=mod

print((ans-1)%mod)
# Judge status: Accepted
N,K=map(int,input().split())
H=[int(i) for i in input().split()]
f_inf=float('inf')
dp=[f_inf]*(N+5)
dp[0]=0
for i in range(1,N):
  for j in range(1,K+1):
    if (i-j)<0:
      continue
    dp[i]=min(dp[i-j]+abs(H[i-j]-H[i]),dp[i])
print(dp[N-1])
# Judge status: Accepted
import math
N = int(input())
xi = []
yi = []

for i in range(N):
  x, y = map(int, input(). split())
  xi.append(x)
  yi.append(y)

L=0

for j in range(N):
  for k in range(N):
    if j >= k:
      continue
    L += math.sqrt((xi[j]-xi[k])**2 + (yi[j]-yi[k])**2)
    
print(2*L/N)
# Judge status: Accepted
n = int(input())
ans = []
Sum = 0
for i in range(1, 10**4):
    Sum += i
    ans.append(i)
    if Sum >= n:
        break

if Sum == n:
    print(*ans)
else:
    ans.remove(Sum - n)
    print(*ans)
# Judge status: Wrong Answer
x, y = map(int, input().split())

a = (2 * x - y) // 3
b = (2 * y - x) // 3
rent_a = (2 * x - y) % 3
rent_b = (2 * y - x) % 3

def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

if rent_a != 0 or rent_b != 0:
    ans = 0
else:
    n = a + b
    ans = combination(n, a)

print(ans)
# Judge status: Accepted
N = int(input())
a = list(map(int,input().split()))
c2 = 0
c4 = 0
for i in range(N):
    if a[i]%4 == 0:
        c4 += 1
    elif a[i]%2 == 0:
        c2 += 1
f = c4 * 2 + 1
if f >= N or f + c2 - 1 >= N:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
s = [input() for i in range(n)]
len(set(s))
# Judge status: Wrong Answer
n,m = map(int,input().split(' '))
h = list(map(int,input().split(' ')))
ansList = [1]*n
numlist = []

for i in range(m):
    a,b = map(int, input().split())
    if h[a-1] > h[b-1]:
        #ansList[a-1] = ma
        numlist.append(b-1)
    else:
        numlist.append(a-1)
for i in list(set(numlist)):
    ansList[i] = 0
print(ansList.count(1))
# Judge status: Accepted
N = int(input())
A = map(int, input().split())
res = [0] * N
for b in A:
    res[b - 1] += 1
for x in res:
    print(x)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
f = 0
for ai in a:
    if ai % 2 == 0:
        if ai % 3 and ai % 5:
            f = 1
            break
if f:
    print('DENIED')
else:
    print('APPROVED')
# Judge status: Wrong Answer
s=input()
if s[-1]=='e':print(s+'s')
else:print(s+'es')
# Judge status: Accepted
n, k = map(int, input().split())
s = list(input())
s[k-1] = s[k-1].lower()
print(''.join(s))
# Judge status: Wrong Answer
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
cnt = [0]*20
cnt[1] = 1
for i in range(1,19):
    cnt[i+1] = cnt[i]*10 + 1
N = int(readline())
if N % 2 == 1:
    print(0)
    sys.exit()
N_str = str(N)
N_str = N_str[::-1]
S = len(N_str)
ans = 0
for i in range(S):
    ans += int(N_str[i])*cnt[i]
print(ans)
# Judge status: Wrong Answer
import sys
import os
from fractions import Fraction

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M = il()
    print('Yes' if int(N * 0.25) >= M else 'No')


if __name__ == '__main__':
    main()
# Judge status: Accepted
# B - String Palindrome
def main():
    S = input().rstrip()
    N = len(S)
    left, right = S[: (N - 1) // 2], S[(N + 3) // 2 - 1:]
    is_palindrome = S == S[::-1]
    check_left = left == left[::-1]
    check_right = right == right[::-1]
    print("Yes" if is_palindrome and check_left and check_right else "No")


if __name__ == "__main__":
    main()
# Judge status: Accepted
N,K = list(map(int,input().split()))
H = sorted([int(input()) for _ in range(N)])
MIN = float('inf')
for i in range(N-K+1):
    MIN = min(MIN,H[i+K-1] - H[i])
print(MIN)
# Judge status: Accepted
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
 
sa = sum(a)
 
for i,b in enumerate(b):
	c = min(a[i],b)
	a[i] -= c
	a[i+1] -= min(a[i+1],b-c)
 
print(sa-sum(a))
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=set(a)
print("YES" if n == len(b) else "NO")
# Judge status: Accepted
import math

a,b,x = map(int,input().split())
if x / a <= a * b / 2:
    print(math.degrees(math.atan(a * b * b / 2 / x)))
else:
    q = 2 * b - 2 * x / a / a
    print(math.degrees(math.atan(q / a)))
# Judge status: Accepted
import copy
N=int(input())
A=[int(input()) for _ in range(N)]
l=[]
for i in range(N):
    l.append([A[i],i])
l.sort(key=lambda x:x[0],reverse=True)
#print(l)
excep=l[0][1]

for i in range(N):
    if i==excep:
        print(l[1][0])
    else:
        print(l[0][0])
# Judge status: Accepted
a, b, h = (int(input()) for i in range(3))

print(int((a + b) * h / 2))
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))
 
mini = 1 << 18
cnt = 0
for i in range(len(p)):
    if p[i] <= mini:
        cnt+=1
        mini = p[i]
 
print(cnt)
# Judge status: Wrong Answer
import math
n = int(input())
s = [list(input()) for S in range(n)]
cnt = 0
for i in range(n):
	s[i].sort()
duplicated_data = [tuple(d) for d in s]
unique_data = set(duplicated_data)
s_set = [list(d) for d in unique_data]
print(s_set)
for j in range(len(s_set)):
	if s.count(s_set[j]) >= 2:
		k = s.count(s_set[j])
		cnt += math.factorial(k)//(math.factorial(k-2)*math.factorial(2))
print(cnt)
# Judge status: Accepted
import numpy as np
 
L=np.array(list(map(int,input().split())))
ans=0
 
while True:
    if L[0]==L[1] and L[1]==L[2]:
        break
    L=sorted(L-max(L))
    if L[1]<L[2]:
        L[0]+=1
        L[1]+=1
        ans+=1
    else:
        L[0]+=2
        ans+=1

print(ans)
# Judge status: Accepted
import sys
readline = sys.stdin.readline

def main():
    N = int(readline())
    S = readline().rstrip()
    res = S[:]

    pls_left = 0
    pointer = 0
    for s in S:
        if s == '(':
            pointer += 1
        else:
            if pointer == 0:
                pls_left += 1
            else:
                pointer -= 1

    pls_right = pointer
    res = '(' * pls_left + S
    res += ')' * pls_right

    print(res)

if __name__ == '__main__':
    main()
# Judge status: Accepted
h = list(map(int, input().split()))

if h[1] < h[3]:
    print((h[2]-h[0])*60+h[3]-h[1]-h[4])
else:
    print((h[2]-h[0]-1)*60+60-h[1]+h[3]-h[4])
# Judge status: Wrong Answer
S = list(input())
T = list(input())

ans = 0

for i in range(len(S)):
  ans += (S[i]==T[i])

print(ans)
# Judge status: Accepted
import bisect
n,k=map(int,input().split())
s=[0 for _ in range((10**5)+1)]
maxa=0
for i in range(n):
    a,b=map(int,input().split())
    s[a]+=b
    maxa=max(maxa,a)
s=s[:maxa]
#print(s)
for i in range(1,len(s)):
    s[i]+=s[i-1]
#print(s)
print(bisect.bisect_left(s, k))
# Judge status: Accepted
s = input()
a = s.index('A')
zl = [i for i, x in enumerate(s) if x == 'Z']
z = zl[len(zl)-1]
print(z-a+1)
# Judge status: Accepted
def main(n: int, m: int):
    ans = 0
    
    ans += min(n, m // 2)
    m -= ans * 2

    ans += m // 4

    print(ans)


if __name__ == "__main__":
    n, m = map(int, input().split())

    main(n, m)
# Judge status: Wrong Answer
H,A = map(int, input().split())
# N = int(input())
# s = int(input())
# C = int(input())
# s= input()
i=0
while H < 0:
    H - A
    i += 1
print(i)
# Judge status: Accepted

def main():
  n = int(input())
  A = list(map(int, input().split()))
  A.append(0)

  money = 1000
  kabu = 0
  for i in range(n):
    a = A[i]
    nxt = A[i + 1]

    if a < nxt:
      cnt = money // a
      money -= cnt * a
      kabu += cnt
    elif a > nxt:
      money += kabu * a
      kabu = 0

  print(money)


main()
# Judge status: Wrong Answer
if __name__ =='__main__':
    s = input()
    ans = 0
    seq = 0
    for c in s:
        if c=='A' or c=='T' or c=='G' or c=='C':
            seq+=1
        else:
            ans = max(ans,seq)
    ans = max(ans,seq)
    print(ans)
# Judge status: Wrong Answer
tmp = list(map(int, input().split()))
n, x, y = tmp
cnt = [0 for k in range(n-1)]

for i in range(n-1):
    for j in range(i+1, n):
        if i+1 > x or j+1 < y:
            cnt[j-i-1] += 1
        else:
            c = j+x+1-i-y
            cnt[c-1] += 1

for c in cnt:
    print(c)
# Judge status: Wrong Answer
from collections import Counter
n = int(input())
D = list(map(int,input().split()))
Dc = Counter(D)
mod = 998244353
ans = 1

if Dc[0]!=1:
    print(0)
else:
    for i in range(max(D)):
        ans *= pow(Dc[i],Dc[i+1])%mod
    print(ans%mod)
# Judge status: Wrong Answer
a = list(map(int,input().split()))
A = a[0]
B = a[1]
K = a[2]
taka = A
aoki = B
if K < A:
    aoki = B
    taka = A - K
elif K>=(A+B):
    pass
else:
    taka = 0
    b = K - A
    aoki = B - b
print(str(taka)+" "+str(aoki))
# Judge status: Accepted
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from bisect import bisect_left, bisect_right


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

    A.sort()
    B.sort()
    C.sort()

    result = 0
    for b in B:
        a = bisect_left(A, b)
        c = bisect_right(C, b)
        result += a * (N - c)

    print(result)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
sx, sy, tx, ty = map(int, input().split())
x = tx-sx
y = ty-sy
first = "U"*y+"R"*x+"D"*y+"L"*x
second = "L"+"U"*(y+1)+"R"*(x+1)+"D"+"L"+"D"*(x+1)+"L"*(y+1)+"U"
print(first+second)
# Judge status: Wrong Answer
string = input()
nums = string.split(' ')

hour = int(nums[2]) - int(nums[0])
minute = int(nums[1]) - int(nums[3])
time = hour * 60 + minute - int(nums[4])

if time > 0:
    print(time)
else:
    print(0)
# Judge status: Accepted
N = int(input())
ans = ''
while N > 0:
	N -= 1
	ans += chr(ord('a') + N % 26)
	N //= 26
print(ans[::-1])
# Judge status: Accepted
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

N = int(input())
A = [0]
for _ in range(N):
    A.append(int(input()))

pos = 1
ans = 0
reached_index = set([1])
while True:
    pos = A[pos]
    ans += 1
    if pos in reached_index:
        ans = -1
        break
    if pos == 2:
        break
    reached_index.add(pos)

print(ans)
# Judge status: Accepted
n = int(input())

BA = []
for i in range(n):
    a, b = map(int, input().split())
    BA.append([b, a])

BA.sort()
t = 0
for i in range(n):
    t += BA[i][1]
    if t > BA[i][0]:
        print("No")
        exit()
print("Yes")
# Judge status: Accepted
S=list(input().split("S"))
print(max(len(s) for s in S))
# Judge status: Accepted
n = int(input())
p = list(map(int,input().split()))
ans = 0
p_min = p[0]
for i in range(n):
    if p_min >= p[i]:
        ans += 1
        p_min = p[i]
print(ans)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(len(A)-1):
    a_before = A[i]
    a_after = A[i+1]

    diff = a_before-a_after

    if diff < 0:
        ans += abs(diff)

print(ans)
# Judge status: Accepted
a, b, m = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
coupone = [list(map(int, input().split())) for _ in range(m)]

ans = min(A) + min(B)
for i in range(m):
    x, y, c = coupone[i]
    ans = min(ans, A[x-1]+B[y-1]-c)
print(ans)
# Judge status: Accepted
A, B, M =list(map(int,input().split()))
a = list(map(int,input().split()))
b = list(map(int,input().split()))
ma=[]
for i in range(M):
    ma.append(list(map(int,input().split())))

ans=min(a)+min(b)
for x,y,m in ma:
    c=a[x-1]+b[y-1]-m
    if c < ans:
        ans = c
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
ans = 0
highest = a[0]
for ai in a:
    if ai <= highest:
        ans += highest - ai
    else:
        highest = ai
print(ans)
# Judge status: Accepted
N,L = map(int,input().split())
S = []
for i in range(N):
    S.append(input())

S.sort()
print(''.join(S))
# Judge status: Accepted
s = list(input())
a = set(s)
if len(s) == len(a):
    print("yes")
else:
    print("no")
# Judge status: Accepted
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

a,b=map(int,input().split())
if a<10 and b<10:
  print(a*b)
else:
  print(-1)
# Judge status: Wrong Answer
h,n=map(int,input().split())
a,b=[],[]
for i in range(n):
  aa,bb=map(int,input().split())
  a.append(aa)
  b.append(bb)
inf=float("inf")
dp=[[inf]*(h+1) for i in range(n+1)]
dp[0][0]=0
for i in range(n):
  for j in range(h):
    dp[i+1][j]=min(dp[i+1][j],dp[i][j])
    dp[i+1][min(h,j+a[i])]=min(dp[i+1][j]+b[i],dp[i+1][min(h,j+a[i])])
    
print(dp[n][h])
# Judge status: Accepted
n = int(input())

pre = [[0]]
ans = [[0]]
s = 'abcdefghijklmnop'

for i in range(n-1):
    ans = []
    for item in pre:
        for j in range(max(item)+2):
            ans.append(item + [j])
    pre = ans[:]

res = []
for item in ans:
    print("".join([s[c] for c in item]))
# Judge status: Accepted
N, R = map(int, input().split())
if N > 10:
  print(R)
else:
  print(R+100*(10-N))
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

for i in range(n):
    a[i]%=4

if a.count(0)>=n//2:
    print('Yes')
elif n-a.count(0)*2<=a.count(2):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a,b,c,k = map(int,input().split())
ans = a-b
if k%2==0:
    print(ans)
else:
    print(ans*(-1))
# Judge status: Accepted
N,M,X,Y = map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))

mx=max(x)
my=min(y)

ans="War"
for i in range(X+1,Y):
  if mx<i<=my:
    ans="No War"
    break
    
print(ans)
# Judge status: Accepted
S = input()

if 0 < int(S[:2]) <= 12 and 0 < int(S[2:]) <= 12:
    print('AMBIGUOUS')
    exit()
elif 0 < int(S[:2]) <= 12:
    print('MMYY')
    exit()
elif 0 < int(S[2:]) <= 12:
    print('YYMM')
    exit()
else:
    print('NA')
    exit()
# Judge status: Accepted
N, K = map(int, input().split())
p = sorted(list(map(int, input().split())))
ans = 0
for i in range(K):
    ans += p[i]

print(ans)
# Judge status: Accepted
x,y=map(int,input().split())
ans=float("INF")
for i in range(4):
    n,m=x,y
    f=0
    if i//2:n=-x;f+=1
    if i%2:m=-y;f+=1

    ans=min(ans,float("INF") if n>m else m-n+f)
print(ans)
# Judge status: Accepted
def nCr(n,r):
  dividend,divisor = 1,1
  for i in range(r):
    dividend *= n-i
    divisor *= 1+i
    dividend %= MOD
    divisor %= MOD

  return (dividend * pow(divisor, MOD-2, MOD)) % MOD

X,Y = map(int,input().split())
INF = 10**15
MOD = 10**9+7

if (X+Y)%3!=0:
  print(0)
  exit()

n = (-X + 2*Y) // 3
m = (2*X - Y) // 3

if n<0 or m<0:
  print(0)
  exit()

print(nCr(n+m, n))
# Judge status: Accepted
n = int(input())

cnt = [[0] * 10 for _ in range(10)]
for i in range(1, n+1):
    cnt[int(str(i)[0])][int(str(i)[-1])] += 1

res = 0
for i in range(1, 10):
    for j in range(1, 10):
        res += cnt[i][j] * cnt[j][i]

print(res)
# Judge status: Accepted
n = int(input())
ans = [0] * (n+1)

for x in range(1, 10**2+1):
    for y in range(1, 10**2):
        for z in range(1, 10**2):
            num = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if num <= n:
                ans[num] += 1
            else:
                break

for res in ans[1:n+1]:
    print(res)
# Judge status: Wrong Answer
list = list(input().split())
list.sort()

if list[0] == 5 and list[1] == 5 and list[7] == 7:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
c_0, c_1, c_2, N = 0, 0, 0, int(input())
for i in map(int, input().split()):
    if i % 4 == 0: c_2 += 1
    elif i % 2 == 0: c_1 += 1
    else: c_0 += 1
if c_1 == 0: result = "Yes" if c_2 >= c_0 - 1 else "No"
else: result = "Yes" if c_2 >= c_0 else "No"
print(result)
# Judge status: Accepted
def calc(K,d,p):
    sum = 0
    if(K > d):
        sum = p * d
    else:
        sum = p * K
    
    return sum,d


def resolve():
    data = [int(i) for i in input().split()]
    sum = 0
    K = data[3]
    for i in range(3):
        add,count= calc(K,data[i],1 - i)
        sum += add
        K -= count
        if(K <= 0):
            break    
    print(sum)
resolve()
# Judge status: Accepted
n=int(input())
data=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
dict={}
for i in range(n):
  a=input()
  for j in data:
    if j not in dict:
      dict[j]=a.count(j)
    else:
      dict[j]=min(dict[j],a.count(j))
ans=[]
for i in dict:
  ans.append(i*dict[i])
print(*ans,sep='')
# Judge status: Accepted
N, *AB = map(int, open(0).read().split())
A = sorted(AB[::2])
B = sorted(AB[1::2])
if N % 2:
    print(B[N // 2] - A[N // 2] + 1)
else:
    print(B[N // 2 - 1] + B[N // 2] - A[N // 2 - 1] - A[N // 2] + 1)
# Judge status: Accepted
N = int(input())
A = [""] * N
for i in range(N):
	A[i] = input()
A.sort()

c, m = 1, [1, []]
for i in range(1, N):
	if A[i - 1] == A[i]:
		c += 1
	else:
		if m[0] == c:
			m[1].append(A[i - 1])
		elif m[0] < c:
			m[1].clear()
			m[1].append(A[i - 1])
			m[0] = c
		c = 1

if m[0] == c:
	m[1].append(A[-1])
elif m[0] < c:
	m[1].clear()
	m[1].append(A[-1])

for i in m[1]:
	print(i)
# Judge status: Accepted
N, P = map(int, input().split())
A = list(map(int, input().split()))

import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def calc(n):
    ans = 0
    for r in range(n-n%2, -1, -2):
        ans += combinations_count(n, r)
    return ans
    
gusu = 0
for a in A:
    if a%2 == 0:
        gusu +=1
kisu = N - gusu

p0 = 2**gusu*calc(kisu)
if P == 0:
    print(p0)
else:
    print(2**N-p0)
# Judge status: Accepted
a,b = map(int,input().split())

if a<=8 and b<= 8:
  print("Yay!")
else:
  print(":(")
# Judge status: Wrong Answer
a,b = (int(x) for x in input().split())

if a+b<=24:
    print(a+b)
else:
    print((a+b)%24)
# Judge status: Accepted
w,h,n=map(int,input().split())
a=[list(map(int,input().split())) for i in range(n)] 
w1=0
h1=0
w2=w
h2=h

for i in a:
    if i[2]==1:
        w1=max(w1,i[0])
    elif i[2]==2:
        w2=min(w2,i[0])
    elif i[2]==3:
        h1=max(h1,i[1])
    elif i[2]==4:
        h2=min(h2,i[1])
if min((w2-w1),(h2-h1))<=0:
    print(0)
else:
    print((w2-w1)*(h2-h1))
# Judge status: Accepted
import math

a,b,h,m = map(int,input().split())

m_ang = m*math.pi/30
h_ang = (h*30+m/2)*math.pi/180
ang = m_ang - h_ang
c = math.sqrt(a*a+b*b-2*a*b*math.cos(ang))

print(c)
# Judge status: Accepted
a, b = map(int, input().split())
c = min(a,b)
s = [1]
i = 2
while i <= c**0.5+1:
  if a%i==0 and b%i==0:
    a //= i
    b //= i
    if not(i in s):
      s.append(i)
  else:
    if a%i==0: a//=i
    if b%i==0: b//=i
    i += 1
  c = min(a,b)
if c!=1 and max(a,b)%c==0 and all([i==1 or c%i>0 for i in s]):
  s.append(c)
print(len(s))
# Judge status: Wrong Answer
s = str(input())
t = str(input())
list_s = list(s)
list_t = list(t)
list_s.sort()
list_t.sort()
if list_s == list_t:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import numpy as np
 
K=int(input())
 
x = np.arange(1, K + 1)
nums = np.gcd.outer(np.gcd.outer(x, x), x)
print(nums.sum())
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()
D, N = map(int, input().split())
print(100**D*N if N<100 else 100**D*(N+1))
# Judge status: Accepted
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda x: [na() for _ in range(x)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda x: [ns() for _ in range(x)]
nas = lambda: stdin.readline().split()

a, b, c = na()
k = ni()
m = max(a, b, c)
print(a + b + c + m * (2 ** k - 1))
# Judge status: Accepted
A,B,C,D=map(int,input().split())

def unko(x,C,D):
  import fractions
  t=int(fractions.gcd(C,D))
  t_=C*D//t
  return x-(x//C+x//D-x//t_)
print(int(unko(B,C,D)-unko(A-1,C,D)))
# Judge status: Accepted
import math
a,b=map(int,input().split())
gcd=math.gcd(a,b)

def prime_factorization(n):
  i=2
  prime=[]
  if n%i==0:
    n//=i
    prime.append(2)
    while n%i==0:
      n//=i
  i+=1
  while i*i<=n:
    if n%i:
      i+=2
    else:
      n//=i
      prime.append(i)
      while n%i==0:
        n//=i
  if n>1:
    prime.append(n)
  return prime

print(len(prime_factorization(gcd))+1)
# Judge status: Accepted
W, a, b = map(int, input().split())
if a <= b <= a + W or a <= b + W <= a + W:
    print(0)
elif a + W < b:
    print(b - a - W)
else:
    print(a - b - W)
# Judge status: Accepted
def summ(n, nn=0):
  nn = max(nn, 0)
  return n*(n+1)/2 - nn*(nn+1)/2

n, k = map(int, input().split())

a = 1
for i in range(k, n + 1):
  mmin = summ(i - 1)
  mmax = summ(n, n - i)
  m = mmax - mmin + 1
  a += m

k = 10**9 + 7
print(int(a%k))
# Judge status: Wrong Answer
A, B = map(int, input().split())
if A + B <= 23:
  print(A + B)
else:
  print(24 - A - B)
# Judge status: Accepted
n,k=map(int,input().split())
P=list(map(int,input().split()))
P.sort()
print(sum(P[:k]))
# Judge status: Wrong Answer
n,m = [int(x) for x in input().split()]
x = sorted([int(x) for x in input().split()])
l = sorted([abs(x[i+1] - x[i]) for i in range(m-1)])

ans = 0

if not l:
    pass
else:
    ans = sum(l[:n+1])

print(ans)