peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
n = int(input())
A = list(map(int, input().split()))

four = 0
odd = 0

for a in A:
    if a % 4 == 0:
        four += 1
    elif a % 2 == 1:
        odd += 1

if odd == 0:
    print('Yes')
else:
    print('Yes' if four >= (four + odd + 1) // 2 else 'No')
# Judge status: Accepted
n = int(input())
ans = ""
if n == 0:
    print(0)
    exit()
while n != 0:
    if n%(-2) == -1:
        ans += "1"
    else:
        ans += "0"
    n //= 2
    n *= -1
print(ans[::-1])
# Judge status: Wrong Answer
n,p = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]

a_odd = [x for x in a if x % 2 == 1]
a_eve = [x for x in a if x % 2 == 0]

if len(a_odd) == 0:
    if p == 0:
        print(2 ** p)
    else:
        print(0)
else:
    print(2 ** (n-1))
# Judge status: Wrong Answer
from math import factorial as F
import itertools

N,M,Q = map(int,input().split())
kumi = []
SUM = 0

for i in range(Q):
    KUMI = list(map(int,input().split()))
    kumi.append(KUMI)

l = list(range(1,M+1))

for i in itertools.permutations(l,N):
    sum = 0
    A = sorted(list(i))
    for x in range(Q):
        if A[kumi[x][1]-1] - A[kumi[x][0]-1] == kumi[x][2]:
            sum += kumi[x][3]
    if sum > SUM:
        SUM = sum

print(SUM)
# Judge status: Wrong Answer
a,b = map(int,input().split())
print((a+b-1)//3)
# Judge status: Accepted
lst = "".join(input().split(" "))
if int(lst)%4 == 0:
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
S = input()

flag = False
target = S[0] #1文字目固定
if target == S[1]:
    if S[2] == S[3]:
        flag = True

if target == S[2]:
    if S[1] == S[3]:
        flag = True

if target == S[3]:
    if S[1] == S[2]:
        flag = True

if flag:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n=int(input())

sum=0
flag=0
fuck=0
a = list(map(int,input().strip().split()))[:n]
for i in a:
    if i==0:
        fuck=1
    #print(f)
    sum=sum*i
    if sum > 10**18:
        flag=1

if fuck == 1:
    print(0)
else:
    if flag==0:
        print(sum)
    else:
        print(-1)
# Judge status: Wrong Answer
def main():
    n, k = map(int, input().split())
    p = list(map(int, input().split()))
    sump = sum(p[0:k])
    tmp = 0
    ind = 0
    for i in range(n-k):
        #print(tmp)
        tmp = sump + (p[i+k] - p[i])
        if tmp > sump:
            sump = tmp
            ind = i+1
        
    e = 0
    for i in range(ind, ind+k):
       e += (p[i]+1) / 2 
    print(e)
    
main()
# Judge status: Wrong Answer
a="b"
b="c"
c="d"
d="e"
e="f"
f="g"
g="h"
h="i"
i="j"
j="k"
k="l"
l="m"
m="n"
n="o"
o="p"
p="q"
q="r"
r="s"
s="t"
t="u"
u="v"
v="w"
w="x"
x="y"
y="z"
z="a"
# Judge status: Accepted
def resolve():
    x, a, b = map(int, input().split())
    la = abs(x-a)
    lb = abs(x-b)

    if la < lb:
        print("A")
    elif lb < la:
        print("B")
resolve()
# Judge status: Wrong Answer
def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    N = read_int()
    A = read_ints()
    A.sort()
    if len(A)%2 == 1:
        median = A[N//2]
    else:
        median = (A[N//2]+A[N//2-1])//2
    return sum(abs(a-median)**2 for a in A)


if __name__ == '__main__':
    print(solve())
# Judge status: Accepted

from collections import defaultdict

S = input()
T = input()

ctr_s = defaultdict(list)
ctr_t = defaultdict(list)
for i in range(len(S)):
    ctr_s[S[i]].append(i)
    ctr_t[T[i]].append(i)

ok = True
for key in ctr_s:
    char = T[ctr_s[key][0]]
    ok &= len(ctr_s[key]) == len(ctr_t[char])
    ok &= all(u == v for u, v in zip(ctr_s[key], ctr_t[char]))

if ok:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
s = input()
dic = {}
for si in s:
  if si not in dic:
    dic[si] = 0
  dic[si] += 1
ans = 1
for k, v in dic.items():
  ans *= (v+1)
print(ans-1)
# Judge status: Accepted
import fractions

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

A, B = list(map(int, input().split()))
print(lcm(A,B))
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
li = [0]*n
for i in a:
    li[i-1] += 1
print(*li, sep="\n")
# Judge status: Wrong Answer
n, c, k = map(int, input().split())
t = sorted(int(input()) for _ in range(n))
cnt = 0
bus_people = 0
bus_time = 0
for i in range(n):
    if bus_people == 0 or t[i] > bus_time:
        bus_people += 1
        bus_time = t[i] + k
        cnt += 1
    else:
        bus_people += 1
        if bus_people == c:
            bus_people = 0
print(cnt)
# Judge status: Accepted
import sys
N=input()
A=[None]+map(int, sys.stdin.readline().split())
B=[None]+map(int, sys.stdin.readline().split())
C=[None]+map(int, sys.stdin.readline().split())

ans=0
prev=None
for a in A:
    if a is None: continue
    ans+=B[a]
    if prev is not None and prev+1==a:
        ans+=C[prev]
    prev=a

print ans
# Judge status: Wrong Answer
n, k = map(int, input().split())
a = list(map(int, input().split()))
b = 1
c = [-1]*n
c[0] = 0
for i in range(n):
    b = a[b-1]
    if c[b-1] == -1:
        c[b-1] = i+1
    else:
        d = i+1-c[b-1]
        break;
b = 1
for i in range(c[b-1]+k%d):
    b = a[b-1]
print(b)
# Judge status: Accepted
# A - Product
# 2つの整数 a × b が偶数か奇数かを判定する。

# 整数 a b の入力
a, b = map(int, input().split())
# print(a, b)

# a × b　を value に代入
value = a * b
# print(value)

# value が 奇数 か 偶数 かを判定する
if value % 2 == 0:
    # print('guusuu')
    answer = 'Even'
else:
    # print('kisuu')
    answer = 'Odd'

# 結果の表示
print(answer)
# Judge status: Accepted
a,b,x,y = map(int,input().split())
print(a*b/2,int(x*2==a and y*2==b))
# Judge status: Accepted
"""
author : halo2halo
date : 31, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = readline().decode('utf8')
print(-S.find('A') + S.rfind('Z') + 1)
# Judge status: Accepted
A,B = map(int,input().split())
if A == B:
    print(2*A)
else:
    print(2*max(A,B)-1)
# Judge status: Accepted


def solve():

    s = input()
    mod = 2019
    remains = [0]*mod

    ans = 0
    now = 0
    remains[0] = 1
    for i, val in enumerate(s[::-1]):
        now += int(val) * pow(10, i, mod)
        now %= mod
        ans += remains[now]
        remains[now] += 1

    print(ans)


if __name__ == "__main__":
    solve()
# Judge status: Accepted
x, y = map(int, input().split())
if x <= y and x < 0 and y > 0:
    print(abs(abs(y) - abs(x)) + 1)
elif x <= y :
    print(y-x)
elif abs(x) == abs(y):
    print(1)
elif x >= 0 and y <= 0:
    print(abs(abs(y)-abs(x))+1)
else:
    print(abs(abs(y)-abs(x))+2)
# Judge status: Accepted
n, k = map(int, input().split())
i = 0
while n >= k ** i:
    i += 1
print(i)
# Judge status: Accepted
n, k = map(int, input().split())
H = sorted([int(input()) for i in range(n)])
print(min(H[i+k-1] - H[i] for i in range(n-k+1)))
# Judge status: Wrong Answer
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    dif = 999
    ans = ''
    for i in range(1, 10):
        tmp = str(i) * 3
        if dif > int(tmp) - n > 0:
            dif = abs(n - int(tmp))
            ans = tmp
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
a,b,k = map(int, input().split())
for i in range (k):
  if a + i <= b-k:
    print(str(a+i))
for i in range (k):
  if a <= b+1-k+i: 
    print(str(b+1-k+i))
# Judge status: Wrong Answer
n,m=map(int,input().split())
if n>=m*2:
    print(m//2)
else:
    print(n+(m-2*n)//4)
# Judge status: Accepted
x, a, b = map(int, input().split())
print('A' if abs(x - a) < abs(x - b) else 'B')
# Judge status: Accepted
x = int(input())
if x == 1:
  print(0)
else:
  print(1)
# Judge status: Accepted
import sys
input = sys.stdin.buffer.readline

n = int(input())
ab = [list(map(int,input().split())) for i in range(n)]
ab = sorted(ab, key=lambda x:(x[1], x[0]))

t = 0
for i in range(n):
    t += ab[i][0]
    if t > ab[i][1]:
        print('No')
        exit()
print('Yes')
# Judge status: Accepted
def resolve():
	n = int(input())
	a = list(map(int, input().split()))
	ans = 0
	while True:
		again = True
		for i in range(n):
			if a[i] % 2:
				again = False
			a[i] = a[i] / 2
		if again:
			ans += 1
		else:
			break
	print(ans)
resolve()
# Judge status: Wrong Answer
n = int(input())
s = input()
turn = [0]
for i in range(n):
  if s[i] == 'W':
    turn.append(turn[-1] + 1)
  else:
    turn.append(turn[-1])
ans = n
for i in range(n - 1):
  ans = min(ans, turn[i] + n - 1 - i - turn[n] + turn[i + 1])
print(ans)
# Judge status: Accepted
N = int(input())

i = int(0)
best_times = int(0)
while i <= N:
    x = i
    answer_times = 0
    while x % 2 == 0 and x != 0:
        answer_times += 1
        x /= 2
    if best_times < answer_times:
        best_times = answer_times
    i += 1

answer = int(2 ** best_times)
print(answer)
# Judge status: Wrong Answer
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
AC = Counter(A)
S = sum(A)
Q = int(input())
for _ in range(Q):
  B,C = map(int, input().split())
  if B not in AC:
    pass
  else:
    count = AC[B]
    S = S + (C-B)*count
    if C in AC:
      AC[C] += count
    else:
      AC[C] = count
  print(S)
# Judge status: Accepted
s = input()
t = input()
list1 = list()
y = list()
for i in range(len(s)):
    if i < (len(s)-len(t)+1):
        list1.append(s[i:(i+len(t))])
for j in range(len(list1)):
    count = 0
    for k in range(len(t)):
        if list1[j][k] != t[k]:
            count = count + 1
    y.append(count)
print(min(y))
# Judge status: Accepted
ROW, COL, K = map(int, input().split())
for row in range(ROW + 1):
    for col in range(COL + 1):
        if row * (COL - col) + col * (ROW - row) == K:
            print('Yes')
            exit()
print('No')
# Judge status: Accepted
def main():
    a, b = map(int, input().split())
    print(sum(list(range(1, b - a))) - a)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
H1,M1,H2,M2,K=map(int,input().split())
if M1>M2:
    print(max((H2-H1-1)*60+(M1-M2)-K,0))
else:
    print(max((H2-H1)*60+(M2-M1)-K,0))
# Judge status: Accepted
N = int(input())
A =  list(map(int, input().split()))

four = 0
odd = 0
for a in A:
    if a % 2 == 1:
        odd += 1
    if a % 4 == 0:
        four += 1
if N % 2 == 1:
    if odd - four <= 1:
        print("Yes")
    else:
        print("No")
else:
    if odd - four <= 0:
        print("Yes")
    else:
        print("No")
# Judge status: Wrong Answer
import math

input()
data = sorted(map(int, input().split(' ')))


s = 0
for i, n in enumerate(data):
    s = s + int(math.pow((-1),(i%2)))*n
print(s)
# Judge status: Wrong Answer
n = int(input())

print(int(0.5*n*(n-1)))
# Judge status: Wrong Answer
a,b=map(int,input().split())

if a*b>0:
    print("Positive")
elif a*b==0:
    print("Zero")
else:
    print("Negative")
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, m = map(int, readline().split())
lr = [list(map(int, readline().split())) for _ in range(m)]

left = 0
right = n
for i in range(m):
    left = max(left, lr[i][0])
    right = min(right,lr[i][1])
print(max(0,right-left+1))
# Judge status: Accepted
sx, sy, tx, ty = map(int, input().split())
dx = tx-sx
dy = ty-sy
ans = 'U'*dy + 'R'*dx + 'D'*dy + 'L'*dx
ans += 'L' + 'U'*(dy+1) + 'R'*(dx+1) + 'D'
ans += 'R' + 'D'*(dy+1) + 'L'*(dx+1) + 'U'
print(ans)
# Judge status: Accepted
X = int(input())-1
flag = True

while True:
    X += 1
    flag = True
    for j in range(2, int(X**0.5) +1):
        if X % j == 0:
            flag = False
            break
    if flag :
        print(X)
        break
# Judge status: Accepted
n = int(input())
li = list(map(int,input().split()))

li.sort()


ans = 0
for i in range(n):
    li.pop()
    ans += li.pop()
    
print(ans)
# Judge status: Accepted
x = int(input())

h_500 = x//500*1000
h_5 = (x%500)//5*5

print(h_500+h_5)
# Judge status: Accepted
from fractions import gcd

n = int(input())
*A, = map(int, input().split())
L, R = [0]*(n+1), [0]*(n+1)
for i, (a, b) in enumerate(zip(A, A[::-1])):
    L[i+1] = gcd(L[i], a)
    R[i+1] = gcd(R[i], b)
L, R = L[:n], R[:n][::-1]
print(max(gcd(l, r) for l, r in zip(L, R)))
# Judge status: Accepted
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def div_ceil(x, y): return (x + y - 1) // y

N, M = map(int, input().split())
*A, = map(int, input().split())
A = list(set([a // 2 for a in A]))
L = A[0]
for a in A[1:]:
    L *= a // gcd(L, a)
for a in A:
    if (L // a) % 2 == 0:
        ans = 0
        break
else:
    ans = div_ceil(M // L, 2)
print(ans)
# Judge status: Accepted
a, b = map(int, input().split())
print((a + b) // 2) if ((a + b) / 2) % 1 == 0 else print('IMPOSSIBLE')
# Judge status: Accepted
k,a,b=map(int,input().split())
ans=1
if b-a<=2: #交換するメリットがない k回すべて一枚増やす
    print(ans+k)
else:
    if k<(a+1):
        print(ans+k)
    else:
        zan=(k-(a-1))
        if zan%2==0:
            print(a+(zan//2)*(b-a))
        else:
            print(a+(zan//2)*(b-a)+1)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

if len(set(a)) == n:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
from bisect import bisect_left

N = int(input())

L = list(map(int, input().split()))
L.sort()

ans = 0


for i in range(N):
    for j in range(i + 1, N):
        c = L[i] + L[j]
        # a+bが入る場所を返す
        idx = bisect_left(L, c)
        ans += max(0, idx - (j + 1))

print(ans)
# Judge status: Accepted
def main4():
    n = int(input())
    m=1
    cnt = 0
    while(n>0):
        cnt += m
        n//=2
        m *= 2
    print(cnt)

if __name__ == '__main__':
    main4()
# Judge status: Accepted
D = int(input())
C = list(map(int, input().split()))
S = [list(map(int, input().split())) for _ in range(D)]
ans = [(i%26)+1 for i in range(1,D+1)]
for i in ans:
    print(i)
# Judge status: Wrong Answer
N=int(input())
x=(N-1)%10**9+1;y=(10**9-N)%10**9
print(0,0,1,10**9,x,y)
# Judge status: Wrong Answer
print("enter S and T value")
S, T = input().split()
print("enter A and B value")
A, B = map(int, input().split())
print("enter U value")
U = input()
if S==U:
  print("{} {}".format(A-1,B))
else:
  print("{} {}".format(A,B-1))
# Judge status: Accepted
import math

n = int(input())

print(1000 * (math.ceil(n / 1000)) - n)
# Judge status: Accepted
S = input()
T = input()
r = 0
for i in range(len(S)):
  if S[i] != T[i]:
    r += 1
print(r)
# Judge status: Accepted
# -*- coding: utf-8 -*-
"""
Created on Thu May 14 13:07:12 2020

@author: shinba
"""

import sys
sys.setrecursionlimit(10**7)
 
def patikaijou(n):
    if n == 0:
        return 1
    else:
        return (n*patikaijou(n-1))%(10**9+7)

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

if abs(n-m) >= 2:
    print(0)
elif n != m:
    print((patikaijou(n)*patikaijou(m))%(10**9+7))
else:
    print((2*((patikaijou(n))**2))%(10**9+7))
# Judge status: Accepted
X = int(input())
ans = 1

for b in range(1,X):
  for p in range(2,10):
    if b**p<=X:
      ans = max(ans,b**p)
      
print(ans)
# Judge status: Accepted
from sys import stdin

a, b = (int(x) for x in stdin.readline().rstrip().split())
if 13 <= a:
    print(b)
elif 6 <= a <= 12:
    print(b//2)
else:
    print(0)
# Judge status: Accepted
S=input()
length=len(S)

change_a=0
for i in range(length):
    if i%2==0 and S[i]=='1':
        change_a+=1
    if i%2==1 and S[i]=='0':
        change_a+=1

change_b=0
for i in range(length):
    if i%2==0 and S[i]=='0':
        change_b+=1
    if i%2==1 and S[i]=='1':
        change_b+=1

print(min(change_a, change_b))
# Judge status: Wrong Answer
# https://atcoder.jp/contests/abc085/tasks/abc085_d
from bisect import bisect_right
from math import ceil
n, h = map(int, input().split())

cut = []
throw = []
for _ in range(n):
    a, b = map(int, input().split())
    cut.append(a)
    throw.append(b)
throw.sort()
MAX = max(cut)
index = bisect_right(throw, MAX)
throw = throw[index:]

attack = 0
for i in range(len(throw)):
    h -= throw[i]
    attack += 1
    if h <= 0:
        break

attack += max(0, ceil(h / MAX))
print(attack)
# Judge status: Wrong Answer
n = int(input())
abl = [list(map(int,input().split())) for nesya in range(n)]
c = 0
for ab in abl:
  a = ab[0] + c
  b = ab[1]
  if a%b == 0:
    continue
  c += (b - a%b)
print(c)
# Judge status: Accepted
a,*b=[],
for z in[*open(0)][1:]:x,y=map(int,z.split());a+=x+y,;b+=x-y,
print(max(abs(max(a)-min(a)),abs(max(b)-min(b))))
# Judge status: Accepted
N, X, Y = map(int, input().split())

ans = [0] * (N + 1)

for i in range(1, N):
    for j in range(i+1, N+1):
        d = min(j-i, abs(X - i) + 1 + abs(Y - j), abs(Y - i) + 1 + abs(X - j))
        #print(i, j, d)
        ans[d] += 1

for i in range(1, N):
    print(ans[i])
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))

ans = sum(a)**2
for i in range(-100,101):
    cost = 0
    for k in a:
        cost += (k-i)**2
    ans = min(cost,ans)

print(ans)
# Judge status: Accepted
k = int(input())
s = list(str(input()))
if len(s) <= k:
    ans = ""
    for i in range(len(s)):
        ans += s[i]
    print(ans)
else:
    ans = ""
    for i in range(k):
        ans += s[i]
    ans += "..."
    print(ans)
# Judge status: Accepted
import numpy as np
N = int(input())
nums = [int(i) for i in input().split()]

new_nums = np.array(sorted([nums[i-1] - i for i in range(1, N+1)]))
b = int(np.median(new_nums))

s = 0
for i in range(1, N+1):
    s += abs(nums[i-1] - (b + i))
print(s)
# Judge status: Accepted
a, b = map(int, input().split())
if a > 0:
  print("Positive")
elif a <= 0 and b >= 0:
  print("Zero")
else:
  if (b - a + 1) % 2 == 0:
    print("Positive")
  else:
    print("Negative")
# Judge status: Accepted
n=int(input())
s=list(map(int,input().split()))
s.sort()
print(s[(n-1)//2+1]-s[(n-1)//2])
# Judge status: Wrong Answer
A,B,K=map(int, input().split())
for i in range(K):
  print(A+i)
for i in range(K):
  print(B-i)
# Judge status: Wrong Answer
# B Polygon
N = int(input())
L = list(map(int, input().split()))
mx = L.pop(L.index(max(L)))
if mx > sum(L):
    print("Yes")
else:
    print("No")
pass
# Judge status: Wrong Answer
import numpy as np
from scipy import optimize
a,b,x = (int(x) for x in input().split())
v = a**2*b
def f(s):
    return v - (a**3*np.tan(s)/2) - x
def g(s):
    return (a**3*np.tan(s)/2) - x
if 2*x >= v:
    c = optimize.fsolve(f,0)
else:
    c = optimize.fsolve(g,0)
print(np.rad2deg(c)[0])
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1, n + 1, 2):
    cnt = 0
    for j in range(1, i + 1):
        if i % j == 0:
            cnt += 1
    if cnt == 8:
        ans += 1

print(ans)
# Judge status: Accepted
s = input()
t = int(s) // 15
print(  800 * int(s) - 200  * int(t) )
# Judge status: Accepted
#coding: utf-8
import math
import heapq
import bisect
import numpy as np
from collections import Counter
#from scipy.misc import comb

MOD = 10**9+7

N = int(input())
A = [list(map(int, input().split())) for i in range(2)]

ans = 0
for i in range(N):
    tmp = 0
    for j in range(i+1):
        tmp += A[0][j]
    for j in range(i,N):
        tmp += A[1][j]
    ans = max(ans,tmp)

print(ans)
# Judge status: Accepted
# coding: utf-8
# Your code here!
N,M=map(int,input().split())
ans=1
MOD=10**9+7
for i in range(1,N+1):
    ans*=i
    ans=ans%MOD
for j in range(1,M+1):
    ans*=j
    ans=ans%MOD

if abs(N-M)>=2:
    print(0)
elif abs(N-M)==1:
    print(ans%MOD)
else:
    print(ans*2%MOD)
# Judge status: Wrong Answer
"""

"""

n = int(input())
l = list(map(int, input().split()))

cnt = 0
for i in range(len(l)):
    for j in range(i+1, len(l)):
        if abs(l[i] - l[j]) == i + j + 2:
            cnt += 1
print(cnt)
# Judge status: Wrong Answer
N = int(input())
A_leaf = list(map(int, input().split()))
s = [0]*(N+2)
for i in range(1, N+2):
    s[i] = s[i-1] + A_leaf[i-1]
node = [1]*(N+1)
for i in range(1, N+1):
    node[i] = min(node[i-1] - A_leaf[i-1], (s[N+1]-s[i]) / 2)*2
    if node[i] <= 0:
        print(-1)
        break
else:
    print(int(sum(node)))
# Judge status: Wrong Answer
n = int(input())
ans = 1
v = []
v = [int(x) for x in input().split()]
for x in v:
	ans = ans*x
	if ans > 1e18:
		break
if ans > 1e18:
	print(-1)
else :
	print(ans)
# Judge status: Accepted
def solve():
    N = int(input())
    print(800 * N - (N // 15) * 200)


if __name__ == "__main__":
    solve()
# Judge status: Accepted
import collections

N = int(input())
S = []
count = 0
for i in range(N):
  S.append(input())

count = len(collections.Counter(S))
         
print (count)
# Judge status: Wrong Answer
N,A,B = map(int,input().split())
ans = 0
for i in range(1,N+1):
    if A<=(i//10)+(i%10)<=B:
        ans+=i
print(ans)
# Judge status: Accepted
x = int(input())

flg = True
while flg:
  for i in range(x):
    if x%(i+2) == 0:
      break
  if i+2 == x:
    flg = False
    break
  x += 1
print(x)
# Judge status: Wrong Answer
s=input()

if s == 'SUN':
    print(0)
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)
# Judge status: Wrong Answer
N=int(input())
C=[0]*(10**6+1)
n=[i for i in range(50)]
n[0]=1
for i in range(40):
    n[i+1]+=(n[i]+1)
for i in range(2,int(N**0.5)+1):
    if N%i==0:
        while N%i==0:
            C[i]+=1
            N//=i
res=0
for c in C:
    if c>0:
        for i in range(50):
            if c<n[i]:
                res+=i
                break
print(1 if N>1 else res)
# Judge status: Accepted
n = int(input())
l = [2, 1]
for i in range(n-1):
    l.append(l[i] + l[i+1])
print(l[n])
# Judge status: Accepted
def II(): return int(input())
def LII(): return list(map(int, input().split()))

n=II()
town=[LII() for _ in range(n)]

distance=0
for i in range(n-1):
    for j in range(i+1,n):
        [xi,yi]=town[i]
        [xj,yj]=town[j]
        
        distance += ((xi-xj)**2+(yi-yj)**2)**0.5

print(distance*2/n)
# Judge status: Accepted
O = list(input())
E = list(input())
ans = []

if len(O) == len(E):
    for i in range(len(O)):
        ans.append(O[i])
        ans.append(E[i])
else:
    for i in range(len(O)-1):
        ans.append(O[i])
        ans.append(E[i])
    ans.append(O[-1])
    
print("".join(ans))
# Judge status: Accepted

N,K=map(int,input().split())
S=input()

print(S[:K-1]+S[K-1].lower()+S[K:])
# Judge status: Accepted
N, M = map(int, input().split())
ans = 0

def cal(x):
    cnt = 1
    for i in range(1, x + 1):
        cnt *= i
        cnt %= (10**9 + 7)
    return cnt


if abs(N - M) >= 2:
    ans = 0
elif abs(N - M ) == 1:
    ans = (cal(N) * cal(M))  % (10**9 + 7)
else:
    ans = (cal(N) * cal(M) * 2) % (10 ** 9 + 7)

print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
a.sort()
ans = 0
for i in range(n, n * 3, 2):
    ans += a[i]
print(ans)
# Judge status: Accepted
S=input()

ans=""

for s in S:
    if s!="B":
        ans+=s
    else:
        if ans!="":
            ans=ans[:-1]
print(ans)
# Judge status: Accepted
s = input()
if int(s[5]) == 1:
    print("TBD")
else:
    if int(s[6])<5:
        print("Heisei")
    else:
        print("TBD")
# Judge status: Wrong Answer
A = int(input())
B = int(input())
C = int(input())
X = int(input())

cnt = 0

for a in range(0,A):
  for b in range(0,B):
    for c in range(0,C):
      if a+b+c == X:
        cnt +=1
# Judge status: Accepted
s1=str(input())
s2=str(input())
if (len(s2)-len(s1)!=1):
  print('No')
Flag='Yes'
for val in range(len(s1)):
  if(s1[val]!=s2[val]):
    Flag='No'
print(Flag)
# Judge status: Accepted
n, a, b = map(int, input().split())

count = 0
for i in range(1, n+1):
    num_str = list(str(i))
    num_int = [ int(j) for j in num_str]
    if a <= sum(num_int) <= b:
        count += i

print(count)
# Judge status: Accepted
import fractions
import functools

def gcd_list(nums):
    return functools.reduce(fractions.gcd, nums)


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