peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
from functools import reduce

def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

def mgcd(*a):
    return reduce(gcd, a)

k = int(input())
ans = 0
for i in range(1, k+1):
  for j in range(1, k+1):
    for l in range(1, k+1):
      tmp = mgcd(i, j, l)
      if i == j== k:
        ans += tmp
      else:
        ans += tmp*3
print(ans)
# Judge status: Wrong Answer
h = int(input())
w = int(input())
n = int(input())
count = 1
if(h >= w):
    while(n > h):
        h += h
        count += 1
    print(count)
else:
    while(n > w):
        w += w
        count += 1
    print(count)
# Judge status: Accepted
S = input()

ans = 0
if S == 'RRR':
    ans = 3
elif 'RR' in S:
    ans = 2
elif 'R' in S:
    ans = 1

print(ans)
# Judge status: Accepted
A, B, K = map(int, input().split())
n = []
for i in range(1, min(A, B)+1):
  if A % i == 0 and B % i == 0:
    n.append(i)
n = sorted(n, reverse = True)
print(n[K-1])
# Judge status: Accepted
a, b, t = map(int, input().split())

now = a
cnt = 0
t += (0.5 - a)
while(t > 0):
    cnt += b
    now += a
    t -= a
print(cnt)
# Judge status: Wrong Answer
import math
n, m = map(int, input().split())

ans = 0
for i in range(1,math.ceil(math.sqrt(m))):
	x = i*n
	y = m-x
	if y < 0:
		break
	if y % i == 0 and m%i == 0:
		ans = i
print (ans)
# Judge status: Wrong Answer
#
#
s = input()
slist = list(s)
#print(slist)
sset = set(slist)
#print(sset)
result = "no"

if len(slist) == len(sset):
  result = "yse"

print(result)
# Judge status: Wrong Answer
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
s = input()
t = input()
res = n*2
for i in range(n):
    if s[-i-1] == t[i]:
        res -= 1
    else:
        break
print(res)
# Judge status: Accepted
x = int(input())
print("YES" if x == 7 or x == 5 or x == 3 else "NO")
# Judge status: Wrong Answer
n = int(input())
s = input()
cnt_w, cnt_b = 0, 0
for i in range(n):
    if s[i] == "#":
        for j in range(i, n):
            if s[j] == ".":
                cnt_w += 1
        break
for i in range(n - 1, -1, -1):
    if s[i] == ".":
        for j in range(i, -1, -1):
            if s[j] == "#":
                cnt_b += 1
        
        break
print(min(cnt_w, cnt_b))
# Judge status: Accepted
import numpy as np

n, m, k = map(int, input().split())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]

a = [0]
b = [0]

a = np.append(a, np.cumsum(A))
b = np.append(b, np.cumsum(B))

j = m
ans = 0
for i in range(n + 1):
    if a[i] > k:
        break
    while a[i] + b[j] > k:
        j -= 1
    ans = max(ans, i + j)
    
print(ans)
# Judge status: Accepted
from bisect import*
INF=10**18
n=int(input())
dp=[-1]*n
for _ in range(n):
  i=int(input())
  dp[bisect_left(dp,i)-1]=i
print(sum([i>=0 for i in dp]))
# Judge status: Accepted
def main():
    S = input().rstrip()
    v1 = int(S[:2])
    v2 = int(S[2:])
    if 1 <= v1 <= 12 and 1 <= v2 <= 12:
        print("AMBIGUOUS")
    elif 1 <= v1 <= 12 and (v2 >= 13 or v2 == 0):
        print("MMYY")
    elif (v1 >= 13 or v1 == 0) and 1 <= v2 <= 12:
        print("YYMM")
    else:
        print("NA")


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n=int(input())
ans=1
for b in range(2,100):
    tmp=1
    for p in range(2,10):
        tmp*=b
        if tmp<n :
            ans=max(ans,tmp)
print(ans)
# Judge status: Accepted
X,A,B=map(int,input().split())
print("dangerous" if X<B-A else "safe" if A<B else "delicious")
# Judge status: Accepted
# coding: utf-8

N = int(input())
A = list(map(int, input().split()))

count = 0
imp = 0

while True:
    for i in range(0, N):
        if int(A[i]) % 2 == 1:
            imp = 1
            break

    if imp == 1:
        break

    for i in range(0, N):
        A[i] = int(A[i] / 2)
    count += 1

print(count)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
list_ = [0]*(10**5+2)

for n in range(N):
  list_[A[n]] += 1

ans = 0
for n in range(0,len(list_)-2):
  _ = list_[n-1] + list_[n] + list_[n+1]
  ans = max(ans,_)

print(ans)
# Judge status: Accepted
N,M=map(int,input().split())
D=[]
ans=0; count=0
for i in range(N): 
    A,B=map(int,input().split())
    D.append([A,B])
D.sort()
for i in range(N):
    if count==M: break
    if D[i][1]+count<=M:
        count+=D[i][1]
        ans+=D[i][0]*D[i][1]
    else:
        ans+=D[i][0]*(M-count)
        count=M
print(ans)
# Judge status: Wrong Answer
n = int(input())
s = list(input())
count = 0
max = 0
for i in range(n):
  if max < count:
    max = count
  if s[i] == "I":
    count += 1  
  elif s[i] == "D":
    count -= 1
print(max)
# Judge status: Accepted
n = input()
s = 0
for i in range(len(n)):
    s += int(n[i])
if s%9==0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
X = list(map(int,input().split()))
ans = []
for i in range(min(X),max(X)+1):
    cnt = 0
    for j in X:
        cnt += (j-i)**2
    ans.append(cnt)#少なくとも1回は追加させるためこの位置にかく
        
print(min(ans))
# Judge status: Wrong Answer
n = int(input())
results = 0
number = 0
for i in range(n):
    if i == 0:
        continue
    count = 0
    v = i + 1
 
    while v % 2 == 0:
        count += 1
        v = v / 2
    if results < count:
        results = count
        number = i + 1
    elif i == 1:
        number = 1
    continue
print(number)
# Judge status: Accepted
n = int(input())
lst = []

for i in range(1,10):
    for j in range(1,10):
        lst.append(i*j)

print("Yes" if n in lst else "No")
# Judge status: Accepted
N,K=map(int,input().split())
A=list(map(int,input().split()))
a=A[:]
for _ in range(K):
    t=[0]*(N+1)
    for i in range(N):
        ti=a[i]
        t[max(0,i-ti)]+=1
        t[min(N,i+ti+1)]-=1
    for i in range(N):
        t[i+1]+=t[i]
    a=t[:N]
    if min(a)==N:
        break
print(*a)
# Judge status: Wrong Answer
s,w=input().split()
if s>w:
  print("safe")
else:
  print("unsafe")
# Judge status: Wrong Answer
n, r = map(int, input().split())
 
if n <= 10:
	print(r + 800)
else:
    print(r)
# Judge status: Accepted
N = int(input())
x = int(N**0.5)+1
ans_1 = N

for i in range(x):
    if N % x == 0:
        ans_1 = x
        break
    else:
        x -= 1

ans_2 = N//ans_1
print(ans_1 + ans_2 - 2)
# Judge status: Accepted
n,m=map(int,input().split())
m2=m//2
if n>=m2:
    print(m2)
else:
    ans=n+(m-2*n)//4
    print(ans)
# Judge status: Wrong Answer
def main():
    s = input()
    ans = 'no'
    if len(set(s)) == len(s):
        ans = 'yes'
    print(ans)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())

if a == b and b == c:
  print(1)
elif a == b and b != c:
  print(2)
elif a != b and b == c:
  print(2)
elif a != c and b == a:
  print(2)
else:
  print(3)
# Judge status: Wrong Answer
N=int(input())
H=list(map(int,input().split()))
ans=0
for i in range(N-1):
  count=0
  for j in range(i+1,N-1):
    if H[i]>=H[j]:
      count+=1
    else:
      ans=max(ans,count)
      i+=1
print(ans)
# Judge status: Accepted
S ={c:list(input()) for c in "abc"}
s = "a"
while S[s]:s=S[s].pop(0)
print(s.upper())
# Judge status: Accepted
n = int(input())
a = int(input())

print("Yes" if n % 500 <= a else "No")
# Judge status: Wrong Answer
W, H, x, y = map(int, input().split())
flag = 0
a = min(H*x,H*(W-x))
b = min(W*y,W*(H-y))
if a==b:
  flag=1
print(max(a,b),flag)
# Judge status: Accepted
w=input()
if w=="RRR":
    print(3)
elif w=="SRR":
    print(2)
elif w=="RRS":
    print(2)
elif w=="RSR":
    print(1)
elif w=="RSS":
    print(1)
elif w=="SRS":
    print(1)
elif w=="SSR":
    print(1)
else :
    print(0)
# Judge status: Accepted
n = int(input())
A=[int(i) for i in input().split()]
k = A[0]
for i in range(n-1):
    k ^= A[i+1]
res = []

for i in A:
    res.append(i^k)
for i in res:
    print(i, end=" ")
# Judge status: Accepted
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())
s = input().strip()
t = input().strip()

ans = n * 2
for i in range(0, n):
    if s[i:n] == t[0:n-i]:
        ans -= (n - i)
        break
print(ans)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)

max_a = max(a)
da = [abs(ai - max_a / 2) for ai in a]
med_i = da.index(min(da))

print("%d %d" % (max_a, a[med_i]))
# Judge status: Accepted
import numpy as np
n = int(input())
A = list(map(int, input().strip().split()))
arr = np.array(A)


print(' '.join(map(str, np.argsort(arr) + 1)))
# Judge status: Accepted
N = int(input())
a = 0
k = 2*(N-2)+1
for i in range(2,N):
    for j in range(i,N):
        if (i*j<N)and(i!=j):
            a+=2
        elif(i*j<N)and(i==j):
            a+=1
        else:
            break
       
print(a+k)
# Judge status: Accepted
N = int(input())
S = list(input())
res = []

for i in range(1, N):
  res.append(len(set(S[:i]) & set(S[i:])))

print(max(res))
# Judge status: Accepted
n,d=map(int,input().strip().split())
d=d*2+1
import math
print(math.ceil(n/d))
# Judge status: Accepted
# Flog 1

N = int(input())
h_list = list(map(int, input().split()))

cost_list = [0 for i in range(N+1)]

# ステップiへたどり着くためのコスト最小値
for i in range(1,N):
    if i==1:
        cost_list[i+1] = abs(h_list[i] - h_list[i-1])
        continue

    step_1 = cost_list[i] + abs(h_list[i]-h_list[i-1])
    step_2 = cost_list[i-1] + abs(h_list[i]-h_list[i-2])
    min_cost = min(step_1, step_2)
    cost_list[i+1] = min_cost


print(cost_list[N])
# Judge status: Wrong Answer
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))


maxNum = 0
cnt = 0


for i in a:
    if k - i > 0:
        k -= i
        cnt += 1
    else:
        break

    for i in b:
        if k - i > 0:
            k -= i
            cnt += 1
        else:
            break
    
    maxNum = max(maxNum, cnt)


print(maxNum)
# Judge status: Accepted
n = int(input())
pmax = 0
pmin = 0
mmax = 0
mmin = 0
for i in range(n):
    x, y = map(int, input().split())
    if(i ==0 or pmax < x + y):
        pmax = x+y
    if(i == 0 or pmin > x+y):
        pmin = x+y
    if(i == 0 or mmax < x-y):
        mmax = x-y
    if(i == 0 or mmin > x-y):
        mmin = x-y
print(max(pmax - pmin, mmax - mmin))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

B = [0]*(N+1)
for l in range(N):
    B[A[l]] += 1
ans = 0
for i in range(N+1):
    ans += int(B[i] * (B[i]-1) / 2)
for k in range(N):
        print(ans - B[A[k]] + 1)
# Judge status: Accepted
k,s=map(int,input().split())
ans=0
for i in range(k+1):
    for j in range(k+1):
        if 0<=s-i-j<=k:
            ans+=1
print(ans)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
s = input().rstrip()
s_rev = s[::-1]
mina = -1
maxz = -1
for i in range(len(s)):
    if s[i] == "A":
        mina = i
for j in range(len(s)):
    if s[j] == "Z":
        maxz = max(maxz, j)
print(maxz - mina + 1)
# Judge status: Wrong Answer
from math import ceil


def main():
    N = int(input())
    i = 2
    is_prime_number = True
    while i ** 2 <= N:
        if N % i == 0:
            is_prime_number = False
            break
        i += 1
    if is_prime_number:
        print(N - 1)
    else:
        print(ceil(2 * (N ** 0.5) - 2))


if __name__ == '__main__':
    main()
# Judge status: Accepted
n,m = map(int,input().split())
base = [int(input()) for i in range(m)]
i= 0
j = 0

dp = [0]*(n+1)
if m == 0:
  base = [n+1]

if 1 == base[j]:
  dp[1] = 0
  if j < m-1:
    j = j + 1
else:
  dp[1] = 1

dp[0] = 1

for i in range(2,n+1):
  if not (i == base[j]):
    dp[i] = dp[i-1] + dp[i-2]
  elif i == base[j]:
    if j < m-1:
      j = j + 1
  
  
print(int(dp[n]%1000000007))
# Judge status: Accepted
a,b,x=list(map(int,input().split()))
print(b//x-(a-1)//x)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = set()

for i in range(n-1):
  if a[n-1-i]&1:
    b.add(n-i)
    for j in range(2, int((n-i)**0.5)+1):
      if (n-i)%j == 0:
        a[j-1] += 1
        if (n-i)//j != j:
          a[(n-i)//j -1] += 1
if a[0] != len(b)%2:
  b.add(1)
          
print(len(b))
if len(b)>0:
  print(*b)
# Judge status: Accepted
#文字列ｓのうちA～Zまでを取り出す
s = list(input())
sa = s.index("A")
m = [i for i, x in enumerate(s) if x == 'Z']

mz = int(m[-1])+1

p = (s[sa:mz])
print(len(p))
# Judge status: Accepted
s = input()

d = len(s)
ans = [0] * 10
tmp = 0
for i in range(d):
    if s[i] in "ACGT":
        ans[tmp] += 1
    else:
        tmp += 1
print(max(ans))
# Judge status: Accepted
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if V <= W:
    if A == B:
        print('YES')
        exit()
    else:
        print('NO')
        exit()
else:
    t = abs(A-B)/(V-W)
    if T >= t:
        print('YES')
    else:
        print('NO')
# Judge status: Wrong Answer
N=int(input())
list = list(map(int, input().split()))

l=len(list)
m=0
i=0
j=1
r=0

while(i<l):
  if(m < abs(list[i]-j)):
    m = j
  i+=1
  j+=1

k=0

while(k<l):
  r+=abs(list[k]-m)*abs(list[k]-m)
  k+=1

print(r)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
if a <= c <= b:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
c=[]
for i in range(3):
    c.append([int(i) for i in input().split()])

a1,a2,a3=[0,c[1][1],c[2][1]-c[0][1]]
b1,b2,b3=[c[0][0],c[0][1],c[0][2]]

ans=[[a1+b1,a1+b2,a1+b3],[a2+b1,a2+b2,a2+b3],[a3+b1,a3+b2,a3+b3]]

if ans==c:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import sys

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

for i in range(1, 1001):
    if A <= i * K and i * K <= B:
        print("OK")
        sys.exit()
        
print("NG")
# Judge status: Accepted
# -*- coding: utf-8 -*-
# Vacation

'''
3
10 40 70
20 50 80
30 60 90
'''

N = int(input())

dp = [[None] * 3 for _ in range(N)]
dp[0] = list(map(int, input().split()))
# print(dp)

for i in range(1, N):
    data = list(map(int, input().split()))
    # print(data)

    dp[i][0] = max(dp[i-1][1], dp[i-1][2]) + data[0]
    dp[i][1] = max(dp[i-1][0], dp[i-1][2]) + data[1]
    dp[i][2] = max(dp[i-1][0], dp[i-1][1]) + data[2]

# print(dp)
print(max(dp[N-1]))
# Judge status: Wrong Answer
n,d = map(int,input().split())
import math
print(math.ceil((n-1)/(2*d+1)) )
# Judge status: Wrong Answer
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: Wrong Answer
N,K=map(int,raw_input().split())
if N/K%2==0:
    print "0"
else:
    print "1"
# Judge status: Wrong Answer
x=int(input())

def is_prime(c):
  for i in range(2,int(c**(1/2))+2):
    if c%i!=0:
      return False
  return True

for i in range(x,10004):
  if is_prime(i):
    print(i)
    break
  else:
    i+=1
# Judge status: Accepted
a,b = map(int, input().split())
if (a*b%2 == 1):
  print('Odd')
else:
  print('Even')
# Judge status: Accepted
S = input()
T = input()

if S == T[:len(T)-1]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted

N = int(input())
X = list(map(int, input().split()))

cur = 0
flag = True
for i in range(N):
    cur = max(cur, X[i])
    if cur - X[i] > 1:
        flag = False

if flag:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())
A = [int(i) for i in input().split()]
max_count = 0

for X in range(1, max(A)):
    count = 0
    for i in A:
        if X-1 <= i <= X+1:
            count += 1
    
    if count > max_count:
        max_count = count

print(max_count)
# Judge status: Accepted
def main():
    a, b = map(int, input().split())
    num_neg = 0
    if a <= 0 and b >= 0:
        print('Zero')
        return
    elif a > 0:
        print('Positive')
        return
    else:
        num_neg = b - a
        if num_neg % 2 == 1:
            print('Positive')
            return
        else:
            print('Negative')
            return


if __name__ == '__main__':
    main()
# Judge status: Accepted
x,y = map(int,input().split())
for c in range(2,1000000):
    if c * x % y != 0:
        print(c * x)
        break
else:
    print(-1)
# Judge status: Accepted
A,B,C,D = map(int,input().split(' '))
count1 = 0
while A > 0:#先攻高橋のモンスターが死ぬまでの回数
    A -= D
    count1 += 1
count2 = 0
while C > 0:#後攻青木のモンスターが死ぬまでの回数
    C -= B
    count２ += 1 
if count1>count2:
    #青木のモンスターが先死んだ→高橋の勝ち
    print('Yes')
elif count1<count2:
    print("No")
elif count1 == count2:
    print("Yes")
# Judge status: Wrong Answer
n = int(input())
if n % 2 == 0:
    print((n)/(n/2)/n)
else:
    print((n + 1)/2/n)
# Judge status: Wrong Answer
k,x=map(int,input().split())
print([i for i in range(x-(k-1), x+(k-1)+1)])
# Judge status: Wrong Answer
n = int(input())
a = [int(input()) for i in range(n)]

l = sorted(a)
same = 1
count = 0
for i in range(1, n):
    if l[i] == l[i - 1]:
        same += 1
        continue
    elif same % 2 == 1:
        count += 1
    same = 1
if l[n - 1] != l[n - 2]:
    count += 1
print(count)
# Judge status: Accepted
A,B,C,K = map(int,input().split())
if K%2==0:
    print(A-B)
else:
    print(B-A)
# Judge status: Accepted
a, b, x = map(int, input().split())

if a%x == 0:
    print(b//x-a//x+1)
else:
    print(b//x-a//x)
# Judge status: Accepted
import itertools

n,m,q=map(int,input().split())
lis=[list(map(int,input().split())) for i in range(q)]
ans=0

l=[]
for v in itertools.combinations_with_replacement(list(range(1,m+1)), n):
    l.append(list(v))

for i in l:
    ans1=0
    for j in range(q):
        ans1+=lis[j][3]*((i[lis[j][1]-1]-i[lis[j][0]-1])==lis[j][2])
    ans=max(ans,ans1)
print(ans)
# Judge status: Accepted
n = int(int(input()))
count = 0
for i in range(n):
  l = list(str(i+1))
  if len(l) % 2 == 1:
    count+=1
print(count)
# Judge status: Accepted
a,b,c = map(int,input().split())
if c-(a-b)<0:
    print(0)
else:
    print(c-(a-b))
# Judge status: Accepted
N = int(input())
L = list(map(int, input().split()))

if max(L)*2 < sum(L):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N, K = map(int, input().split())
cnt = 0

while N > 0:
    N = N // K
    cnt += 1
    
print(cnt)
# Judge status: Accepted
a,b,c=map(int,input().split())
if a<c<b or b<c<a:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
a,b=map(int,input().split())
list1=[1,3,5,7,8,10,12]
list2=[4,6,9,11]
list3=[2]

if a in list1 and b in list1:
  print("Yes")
elif a in list2 and b in list2:
  print("Yes")
elif a in list3 and b in list3:
  print("Yes")
else: 
  print("No")
# Judge status: Accepted
print('vowel' if input() in ['a','e','i','o','u'] else 'consonant')
# Judge status: Accepted
a, b = map(int, input().split())
ans = -1
for i in range(10000, -1, -1):
    ans1 = int(i * 0.08)
    ans2 = int(i * 0.1)
    if ans1 == a and ans2 == b:
        ans = i
print(ans)
# Judge status: Accepted
"""
author : halo2halo
date : 16, Jan, 2020
"""

import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline())
L = list(map(int, readline().split()))
Lm=max(L)
S = sum(L)
ans = True

print('Yes' if S>2*Lm else 'No')
# Judge status: Accepted
N,M= list(map(int,input().split()))
dot=[1]*N
sw=[0] * N
sw[0]=1
for i in range(M):
   a,b=list(map(int,input().split()))
   a-=1;b-=1
   dot[a]-=1
   dot[b]+=1
   if sw[a]:
      sw[b]=1
   if dot[a] == 0:
      sw[a]=0
print(sw.count(1))
# Judge status: Accepted
N = int(input())
if(N>1):
    all = 2**N * ((5**N) + (4**N)) - 2 * (9**N)
else:
    all = 0
print(all % 1000000007)
# Judge status: Wrong Answer
w = list(input())
ans = float("inf")
for i in range(len(w)-2):
  c = abs(int("".join(w[i:i+3])))
  if c < ans:
    ans = c
print(ans)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
ans=0
for i in range(N):
    if A[i]>B[i]:
        ans+=B[i]
    elif A[i]<=B[i]<A[i]+A[i+1]:
        ans+=B[i]
        A[i+1]-=B[i]-A[i]
    else:
        ans+=A[i]+A[i+1]
        A[i+1]=0
print(ans)
# Judge status: Accepted
N,P=map(int,input().split())
*A,=map(int,input().split())

B=[a%2 for a in A]
if sum(B)==0:
    print((P==0)*2**N)
else:
    print(2**(N-1))
# Judge status: Wrong Answer
n = int(input())
ll = []
for _ in range(n):
    s = int(input())
    ll.append(s)

ll.sort()
ans = sum(ll)
i = 0
while ans%10 == 0:
    ans -= ll[i]
    i += 1
    if ans == 0:
        break

print(ans)
# Judge status: Wrong Answer
from collections import defaultdict
n, *D  = [list(map(int, s.split())) for s in open(0)]
D = D[0]
dic = defaultdict(int)
for d1 in D:
    dic[d1] += 1

total_comb = 0
for k in dic:
    if dic[k] >= 2:
        total_comb += dic[k] * (dic[k] - 1) / 2

for d2 in D:
    comb = 0
    if dic[d2] >= 2:
        print(int(total_comb - dic[d2] + 1))
    else:
        print(total_comb)
# Judge status: Accepted
from fractions import gcd
A,B=map(int,input().split())
print(A*B//gcd(A,B))
# Judge status: Accepted
# A - Takahashikun, The Strider
x = int(input())
i = 1

while True:
  if 360 * i % x == 0:
    print(360 * i // x)
    break
  else:
    i += 1
# Judge status: Accepted
n = int(input())
s = input()
x = [0]
for i in s:
    if i == "I":
        x.append(x[-1]+1)
    else:
        x.append(x[-1]-1)
print(max(x))
# Judge status: Accepted
a,b = map(int,input().split())
if a <= 0 <= b:
    print('Zero')
elif 0 < a <= b:
    print('Positive')
else:
    if (b - a + 1) % 2 == 0:
        print('Positive')
    else:
        print('Negative')
# Judge status: Accepted
n = int(input())

lst = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}


for i in range(n):
  s = input()
  lst[s] += 1

lst_ans = ['AC', 'WA', 'TLE', 'RE']
for i in lst_ans:
  print("{} x {}".format(i, lst[i]))
# Judge status: Accepted
price = int(input())

prime_cost = int(price / 1.08)

if (prime_cost * 1.08)//1 == price:
      print(prime_cost)
elif ((prime_cost + 1) * 1.08)//1 == price:
      print(prime_cost + 1)
else:
      print(":(")
# Judge status: Accepted
N = int(input())
S =""
for i in range(100):
    if N==0:break
    if N%pow(2,i+1)!=0:
        S+="1"
        N-=pow(-2,i)
    else:S+="0"
print("0" if S=="" else S[::-1])
# Judge status: Wrong Answer
a=list(map(int,input().split('/')))
#print(a)
if a[0]==2019:
    if a[1]==4:
        if 30<=a[2]:
            print("Heisei")
        else:
            print("TBD")
    elif 5<=a[1]:
        print("Heisei")
    else:
        print("TBD")
elif 2019<a[0]:
    print("Heisei")
else:
    print("TBD")
# Judge status: Wrong Answer
def resolve():
    N = int(input())
    count = 7
    if N%2 == 0:
        print("-1")
    elif N%5 == 0:
        print("-1")
    else:
        for i in range(N):
            count += (10**i)*7
            if count % N == 0:
                print(i+1)
                exit()
resolve()
# Judge status: Wrong Answer
a,b,c=list(map(int ,input().split()))

if(a>b):
    print(0)
    
elif(a*c < b):
    print(c)
elif(a*c >b ):
    ans=b/a
    print(int(ans))
# Judge status: Accepted
n = int(input())
button = []
for i in range(n):
  button.append(int(input()))
times = 0
next_button = 1
while times < n:
  times += 1
  next_button = button[next_button-1]
  if next_button == 2:
    print(times)
    exit()
print(-1)
# Judge status: Wrong Answer
a=int(input())
x = 0
i = 1
while(1):
  x += a
  i += 1
  x %= 360
  if x:
    continue
  else:
    print(i)
    quit()
# Judge status: Accepted
W, H, N = map(int, input().split())

board = [[1]*W for _ in range(H)]

for _ in range(N):
    x, y, a = map(int, input().split())
    t = 0
    b = H
    l = 0
    r = W
    if a == 1:
        r = x
    if a == 2:
        l = x
    if a == 3:
        b = y
    if a == 4:
        t = y
    
    for h in range(t, b):
        for w in range(l, r):
            board[h][w] = 0
    
print(sum([sum(r) for r in board]))
# Judge status: Wrong Answer
A,B=map(float,input().split())
print(int(A*int(B*100))//100)