peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    K=int(input())
    print(K//2*(-(-K//2)))

if __name__ == '__main__':
    main()
# Judge status: Accepted
S = input()
T = input()

count = []
for i in range(len(S)-len(T)+1):
    num = 0
    for j in range(len(T)):
        if S[i+j] != T[j]:
            num += 1
    count.append(num)
print(min(count))
# Judge status: Accepted
n = int(input())
s = input()
l = [chr(i) for i in range(65, 65+26)]
l.extend(l)
ans = ""
for i in s:
    a = l.index(i)
    ans += l[a+n]
print(ans)
# Judge status: Wrong Answer
A, B, C, X, Y = map(int, input().split())

print(min(C*2*min(X, Y)+abs(X-Y)*min(A, B),
          C*2*max(X, Y), C*2*max(X, Y)+abs(X-Y)*min(A, B), A*X+B*Y))
# Judge status: Accepted
n,p = map(int,input().split())
a_list = list(map(int,input().split()))
dp = [[0,0] for i in range(n+1)]
dp[0][0] = 1
dp[0][1] = 0
for i in range(n):
  if a_list[i] % 2 == 0:
    dp[i+1][0] = dp[i][0] + dp[i][0] 
    dp[i+1][1] = dp[i][1] + dp[i][1]
  if a_list[i] % 2 == 1:
    dp[i+1][0] = dp[i][0] + dp[i][1] 
    dp[i+1][1] = dp[i][1] +dp[i][0] 
    
print(dp[-1][p])
# Judge status: Accepted
def comb(n, k, mod=10**9+7):
    num = den = 1
    for i in range(k):
        num *= n - i
        den *= i + 1
    return num // den

N, P = map(int, input().split())
A = list(map(int, input().split()))
cnt = [0] * 2
for a in A:
    cnt[a % 2] += 1
even = 0
odd = [0] * 2
for i in range(N+1):
    even += comb(cnt[0], i)
    odd[i % 2] += comb(cnt[1], i)
print(even * odd[P])
# Judge status: Accepted
N = int(input())
T = [input().split() for _ in range(N)]
T = [(i, t[0], int(t[1])) for i, t in enumerate(T, 1)]

T.sort(key=lambda x: (x[1], -x[2]))
for t in T:
    print(t[0])
# Judge status: Accepted
prev = "-"
b = flag = j = 0
for i in input():
    j += 1
    if flag:
        flag = 0
        prev = "-"
        continue
    if prev==i:
        b += 1
        flag = 1
    prev = i
print(j-b)
# Judge status: Wrong Answer
n = int(input())

if n == 19 or n == 29 or n == 39 or n == 49 or n == 59 or n == 69 or n == 79 or n == 89 or n == 99:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

K, A, B = mapint()
if (B-A)/2<=1:
    print(K+1)
else:
    cnt = A
    rest = K - cnt + 1
    if rest<3:
        print(K+1)
    else:
        if rest%2==0:
            print(cnt+(B-A)*rest//2)
        else:
            rest -= 1
            cnt += 1
            print(cnt+(B-A)*rest//2)
# Judge status: Accepted
n = int(input())
a = sorted(list(map(int, input().split())))
ans = 0
for i in range(n,3*n,2):
    ans += a[i]
print(ans)
# Judge status: Accepted
N, M=map(int, input().split())
ball=[1]*N
red=[0]*N
red[0]=1
for i in range(M):
  x, y = map(int, input().split())
  ball[x-1]-=1
  ball[y-1]+=1
  if red[x-1]==1:
    red[y-1]=1
    if ball[x-1]==0:
      red[x-1]=0
print(sum(red))
# Judge status: Accepted
N = int(input())
print((N * 800) - (N//15 *200))
# Judge status: Accepted
N=int(input())
if N == 1:
    print(1)
    exit()

l0=2
l1=1
for i in range(2,N+1):
    L = l1 + l0
    l0 = l1
    l1 = L

print(L)
# Judge status: Accepted
import math

n, d = map(int, input().split())
p = [list(map(int, input().split())) for _ in range(n)]

ans = 0
for i in range(n):
	for j in range(i+1, n):
		dist = 0
		for k in range(d):
			dist += math.pow(p[i][k]-p[j][k], 2)
		dist = math.sqrt(dist)
		if dist.is_integer():
			ans += 1

print(ans)
# Judge status: Accepted
import sys
input = sys.stdin.readline
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]

from collections import Counter
Answer = Counter(A)

for i in range(1,N+1) :
    if K-Q+Answer[i] > 0 :
        print("Yes")
    else :
        print("No")
# Judge status: Accepted
s = input()
print("Yes" if s[2] == s[3] and s[4] == s[5] else "No")
# Judge status: Accepted
# coding: utf-8
s=list(input())
t=list(input())

s.sort(reverse=True)
t.sort(reverse=True)

if s[-1]<t[0]:
    print('Yes')
else:
    if set(s)==set(t) and len(t)>len(s):
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
s=input()

for i in range(2**3):
    S=s[0]
    tot=int(s[0])
    for j in range(3):
        if (i>>j)&1:
            S+='+'+s[j+1]
            tot+=int(s[j+1])
        else:
            S+='-'+s[j+1]
            tot-=int(s[j+1])
    if tot==7:
        print(S+'=7')
        exit(0)
# Judge status: Wrong Answer
list_1=[w for w in input()]
result='Yes'
even_list=['L','U','D']
odd_list=['R','U','D']
for item in list_1[::2]:
  if item not in even_list:
    result='No'
    print (result)
    exit()
for item in list_1[1::2]:
  if item not in odd_list:
    result='No'
    print (result)
    exit()
print (result)
# Judge status: Accepted
import numpy as np
N = int(input())
x = np.arange(1, int(N ** 0.5 + 1))
div = x[N % x==0]
print(int(np.min(div + N / div)) - 2)
# Judge status: Accepted
N = int(input())
S = input()

R = S.count("R")
G = S.count("G")
B = S.count("B")
ignore = 0
for i in range(N):
    a = S[i]
    for j in range(1,N):
        if i + j + j >= N:
            break
        b = S[i+j]
        c = S[i+j+j]
        if a != b and b != c and c != a:
            ignore += 1
print(R * G * B - ignore)
# Judge status: Wrong Answer
def resolve():
    n=int(input())
    a=list('abcdefghijklmnopqrstuvwxyz')
    ans=[]
    while n>0:
        ans.append(a[((n-1)%26)])
        n//=26
    print(''.join(map(str,ans[::-1])))


if __name__ == '__main__':
    resolve()
# Judge status: Accepted
#!/usr/bin/env python3
print("Yes") if len(set(input())) > 1 else print("No")
# Judge status: Accepted
a, b, c = map(int,input().split())
ans = 'Yes' if a <= c <= b else 'No'
print(ans)
# Judge status: Accepted
def resolve():
	S = input()
	mark = ""
	count = 0
	max_count = 0
	for s in list(S):
		if s == "R":
			count += 1
		else:
			max_count = max(max_count, count)
			count = 0
			mark = s
	max_count = max(max_count, count)
	print(max_count)
resolve()
# Judge status: Wrong Answer
A = input().split()
B = input().split()
C = input().split()
X = 'a'
while len(A) != 0 and len(B) != 0 and len(C)!=0:
  if X  == 'a':
    X = A.pop(0)
  elif X =='b':
    X = B.pop(0)
  else:
    X = C.pop(0)
if len(A) ==0:
  print('A')
elif len(B) ==0:
  print('B')
else:
  print('C')
# Judge status: Accepted
n = int(input())
li = list(map(int, input().split()))
cnt = 0
for _ in range(10**9):
    if all(x%2==0 for x in li):
        cnt += 1
        li = list(map(lambda x: (x+1)//2, li))
    else:
        break
print(cnt)
# Judge status: Accepted
a,b,c = input().split()
b1 = a
a1 = b
c1 = a1
a1 = c
print('{} {} {}'.format(a1,b1,c1))
# Judge status: Accepted
s = list(input())
ans = 0
r = list(reversed(s))

for i in range(len(s)//2):
    if s[i] != r[i]:
        ans += 1
print(ans)
# Judge status: Accepted
n=int(input())
k=int(input())
x=int(input())
y=int(input())

sum=0

if n>=k:
    sum=k*x
    sum=sum+(n-k)*y

if n<k:
    sum=n*x

print(sum)
# Judge status: Accepted
X=int(input())
H=[1]

i=2
while i<=X**0.5:
    j=2
    while i**j<=X:
        H.append(i**j)
        j+=1
    i+=1

print(sorted(H)[-1])
# Judge status: Wrong Answer
h, n = map(int, input().split())
ablis = []
for i in range(n):
    a, b = map(int, input().split())
    ablis.append([a/b, a, b])
ablis.sort(reverse=True)
score = (h // ablis[0][1]) * ablis[0][2]
h = h - (h // ablis[0][1]) * ablis[0][1]
while h > 0:
    for i in range(n):
        if ablis[i][1] > h:
            ablis[i][0] = (h/ablis[i][2])
    ablis.sort(reverse=True)
    h = h - ablis[0][1]
    score += ablis[0][2]
print(score)
# Judge status: Accepted
import itertools
import math

n = int(input())
point = [tuple(map(int, input().split())) for i in range(n)]

numbers = 1
for i in range(1,n+1):
    numbers *= i
#nの階乗

route = list(itertools.permutations(point))

d = 0

for pattern in route:
    for i in range(n-1):
        d += math.sqrt((pattern[i][0]-pattern[i+1][0])**2 + (pattern[i][1]-pattern[i+1][1])**2)
        

ans = d / numbers

print(ans)
# Judge status: Wrong Answer
c_1 = list(map(int, input().split()))
c_2 = list(map(int, input().split()))
c_3 = list(map(int, input().split()))
c = c_1 + c_2 + c_3
if sum(c) % 3 == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import math
n = int(input())
xy = [list(map(int, input().split())) for i in range(n)]
ans = 0
for i in range(n-1):
    for j in range(i+1,n):
        d = 0
        for k in range(2):
            d+= (xy[i][k]-xy[j][k])**2
        ans += math.sqrt(d)
print(ans*2/n)
# Judge status: Accepted
import sys
N = int(input())
T,A = map(int,input().split())
array_hight = list(map(int,input().split()))

min = max(array_hight)
point = ''
for I in array_hight:
    if abs(A - (T - (I * 0.006))) < min:
        min = abs(A - (T - (I * 0.006)))
        point = array_hight.index(I)
print(int(point)+1)
# Judge status: Wrong Answer
import math
import fractions
from functools import reduce

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

def lcm_list(numbers):
    return reduce(lcm, numbers)

n, m = map(int, input().split())
a_list = sorted(set(map(int, input().split())))
prod = 1
for a in a_list:
    prod *= a // 2
lcm = lcm_list(a_list)
if prod > m:
    print(0)
else:
    print((m - prod) // lcm + 1)
# Judge status: Wrong Answer
n = int(input())
s = input()
nw = len(s.replace('R',''))
nr = n - nw

tmp_w = 0
ret = n
w_left = 0
for i, c in enumerate(s):
    if c == 'W':
        w_left += 1
    r_right = n - 2*i - 2 +  w_left
    ret = min(ret, max(r_right, w_left))
print(ret)
# Judge status: Accepted
s = input()

if len(set(s)) == 2:
  if s.count(s[0]) == 2:
    print("Yes")
  else:
    print("No")
else:
  print("No")
# Judge status: Accepted
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 19 20:52:57 2020

@author: over-
"""

S=input()
N=len(S)

ans="Yes"

for i in range(int((N-1)/2)):
    if S[i]!=S[N-i-1]: ans="No"

for i in range(int((N-1)/2/2)):  
    if S[i]!=S[int((N-1)/2)-i-1]: ans="No"

for i in range(int(N-(N+3)/2)):
    #print(S[int((N+3)/2)+i],S[N-i-1])
    if S[int((N+3)/2)+i-1]!=S[N-i-1]: ans="No" 

print(ans)
# Judge status: Wrong Answer
s=input()

count=0
for i in range(3):
    if s[i] == "R":
        count+=1
        max=count
    else:
        max=count
        count=0
print(max)
# Judge status: Accepted
n = int(input())
dp = [float('Inf')] * (n + 1)
dp[0] = 0
for i in range(1, n + 1):
    j = 1
    while j <= i:
        dp[i] = min(dp[i], dp[i - j] + 1)
        j *= 6
    j = 1
    while j <= i:
        dp[i] = min(dp[i], dp[i - j] + 1)
        j *= 9
print(dp[n])
# Judge status: Wrong Answer
n,m = map(int, input().split())
s = [tuple(map(int,input().split())) for _ in range(n)]
c = [tuple(map(int,input().split())) for _ in range(m)]
for i in range(n):
  mini = 100000001
  m_i = 0
  for j in range(m):
    dis = abs(s[i][0]-c[j][0])+abs(s[i][1]-c[j][1])
    if mini > dis: mini, m_i = dis, j+1
  print(m_i)
# Judge status: Wrong Answer
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n, m = map(int, input().split())
    ab = [list(map(int, input().split())) for _ in range(n)]
    ab.sort(reverse=True, key=lambda x: (x[1], x[0]))

    ans = 0
    d = 0

    for a, b in ab:
        if a + d <= m:
            ans += b
            d += 1
    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()
# Judge status: Accepted
## B - Iron Bar Cutting
N = int(input())
A = list(map(int, input().split()))
L = 0
R = sum(A)
ans = sum(A)
for n in range(N):
    L += A[n]
    R -= A[n]
    if ans > abs(L-R):
        ans = abs(L-R)
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
if n == 1 and m == 1:
    ans = 1
elif n == 1 and m != 1:
    ans = m-2
elif n != 1 and m == 1:
    ans = n-2
else:
    ans = n * m
    ans -= 2*n
    ans -= 2*m
    ans += 4
print(ans)
# Judge status: Wrong Answer
s = input()
q = int(input())

left = []
right = []

for _ in range(q):
    Q = list(input().split())
    if int(Q[0]) == 1:
        left, right = right[::-1], left[::-1]

    else:
        if int(Q[1]) == 1:
            left = [Q[2]] + left
        else:
            right.append(Q[2])

print(''.join(left) + s + ''.join(right))
# Judge status: Accepted
# A - Five Variables
num_list = list(map(int, input().split()))  # n個の数字がリストに格納される
for i in range(len(num_list)):
    if num_list[i] == 0:
        print(i+1)
        break
# Judge status: Wrong Answer
n = input()
s=""
for i in range(len(n)):
    if(n[i]=="B" and s != ""):
        s=s[:-1]
    else:
        s+=n[i]
print(s)
# Judge status: Accepted
n, a, b, c, d = map(int, input().split())
s = input()
a -= 1
b -= 1
c -= 1
d -= 1

# 2個以上の岩があればNG
if "##" in s[a:max(c,d)]:
    print("No")
    exit()

# AがBを抜けるかどうか
if d < c and not "..." in s[b-1:d+2]:
    print("No")
    exit()

print("Yes")
# Judge status: Accepted
n, k = map(int,input().split())
s = input()
if s[k-1] == 'A':
    print(s[:k-1] + 'a' + s[k:])
elif s[k-1] == 'B':
    print(s[:k-1] + 'b' + s[k:])
else:
    print(s[:k-1] + 'c' + s[k:])
# Judge status: Wrong Answer
n=int(input())
s=str(input())
x=0
l=[]
for i in range(n):
  if s[i]=='I':
    x+=1
    l.append(x)
  else:
    x-=1
    l.append(x)
print(max(l))
# Judge status: Accepted
l = list(map(int, input().split()))
if(l[0] %2 == 0 or l[1] %2==0 or l[2]%2==0):
  print(0)
else:
  a = l.pop(l.index(min(l)))
  b = l.pop(l.index(min(l)))
  print(a*b)
# Judge status: Accepted
n,m=map(int,input().split())
a=[input() for i in range(n)]
b=[input() for i in range(m)]
for i in range(n-m+1):
  row=a[i]
  if b[0] in row:
    j=row.find(b[0])
    c=0
    for k in range(i,i+m):
      if a[k][j:j+m]==b[k-i]:
        c+=1
      else:
        break
    if c==m:
      print("Yes")
      exit()
print("No")
# Judge status: Accepted
a, b, c, d = map(int, input().split())
print(max(a * c, a * d, b * c, b * d))
# Judge status: Accepted
a,b = map(int,input().split())
print(a+max(a-1,b) if a>b else b+max(a,b-1))
# Judge status: Accepted
a,b,c=[int(_) for _ in input().split()]
ans = b-a==c-b
print('YES' if ans else 'NO')
# Judge status: Accepted
S=str(input())
S=S[:3]+"8"+S[4:]
print(S)
# Judge status: Wrong Answer
S = input()
if int(S[:2]) == 0 or int(S[2:]) == 0 or \
   (int(S[2:]) >= 13 and int(S[:2]) >= 13):
    print('NA')
elif int(S[:2]) >= 13 and int(S[2:]) < 13:
    print('YYMM')
elif int(S[2:]) >= 13 and int(S[:2]) < 13:
    print('MMYY')
else:
    print('AMBIGUOUS')
# Judge status: Accepted
from functools import reduce
import math
def main():
    n = int(input())
    A = list(map(int, input().split()))
    print(reduce(math.gcd, A))

if __name__ == '__main__':
    main()
# Judge status: Accepted
A, B = map(int, input().split())
print("{}".format(A*B))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
cnt4 = 0
cnt2= 0
for x in a:
    if x%4 == 0:cnt4 +=1
    elif x%2 == 0:cnt2 +=1
odd = n-cnt4 - cnt2
ok = cnt4+1 >= odd
    
 

if ok:print('Yes')
else:print('No')
# Judge status: Accepted
n = int(input())
ans = [0] * (n + 1)

for i in range(1, 110):
    for j in range(1, 110):
        for k in range(1, 110):
            tmp = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
            if tmp <= n:
                ans[tmp] += 1
for i in range(1, n + 1):
    print(ans[i])
# Judge status: Accepted
n=int(input())
ans=[0]*n

for x in range(1,100):
	for y in range(1,100):
		for z in range(1,100):
			v=x**2 + y**2 + z**2 + x*y +y*z +x*z
			if v>n:
				break
			ans[v-1]+=1

print(*ans)
# Judge status: Accepted
import sys

N = int(input())
D = [list(map(int, input().split())) for D in range(N)]
count = 0

for i in range(N):
    if D[i][0] == D[i][1]:
        count += 1
        if count == 3:
            print('Yes')
            sys.exit()
    else:
        count = 0

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

ans=0
for j in range(1,n+1): # 割る数
	a=j #初項
	d=n//j #項数
	tmp=(a+(a*d))*d//2
	ans+=tmp
	
print(ans)
# Judge status: Accepted
import sys
N, A, B = map(int, input().split())

if A == 0:
    print(0)
    sys.exit()

print(A * (N // (A + B)) + min(A, N % (A + B)))
# Judge status: Accepted
n, k = map(int, input().split())
h = list(map(int, input().split()))

h.sort(reverse=True)
del h[0 : min(n, k)]

print(sum(h))
# Judge status: Accepted
a,b=map(int,input().split())
if(a*2>=b):
  print(b//2)
else:
  print(a+(b-2*a)//4)
# Judge status: Wrong Answer
num = int(input())

line = input()
arr = [int(x) for x in line.split(" ")]

post = [0 for x in range(num)]
post[num - 1] = arr[num - 1]
for i in range(2, num + 1):
  post[num - i] = post[num-i+1] + arr[num - i]
  
sum = 0

for i in range(num-1):
  sum += arr[i] * post[i+1]
  sum %= 1e9 + 7
  
print(int(sum))
# Judge status: Accepted
X = input()
if X in ("357"):
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
S = input()
K = int(input())

if K == 1:
    print(S[0])
elif S[0] == '1':
    print(S[1])
else:
    print(S[0])
# Judge status: Wrong Answer
n=int(input()) 
lst=list(map(int,input().split())) 
#print(lst) 
a=[] 

for i in range(n): 
	if i==0: 
		#print(lst[i]) 
		a.append(lst[i]) 
	else: 
		#print(lst[i]) 
		a.append((a[-1]+lst[i])/2)   
print(a[-1])
# Judge status: Accepted
input=input()
if int(input) >= 30:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
a,v = map(int, input().split())
b,w = map(int, input().split())
t = int(input())

if(b > a):
    if(b + w*t <= a + v*t):
        print('YES')
    else:
        print('NO')
if(b < a):
    if(b - w*t >= a - v*t):
        print('YES')
    else:
        print('NO')
# Judge status: Wrong Answer
a,b,c =map(int, input().split())
print(c*10+b+a)
# Judge status: Accepted
s=input()
n=len(s)
ans=0
for i in range(n):
    if s[i]=="0" and i%2==0:
        ans+=1
    elif s[i]=="1" and i%2==1:
        ans+=1
ans1=0
for i in range(n):
    if s[i]=="1" and i%2==0:
        ans1+=1
    elif s[i]=="0" and i%2==1:
        ans1+=1

print(min(ans,ans1))
# Judge status: Wrong Answer
a,b,c,d = map(int,input().split())
x=(c+b-1)/b
y=(a+d-1)/d
print(x,y)
if x<=y:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer

def solve():
    s=input()
    t=input()
    ans=len(t)
    for i in range(0,len(s)-len(t)) :
        diff=0
        for j in range(0,len(t)) :
            diff+= 1 if s[i+j]!=t[j] else 0
            if diff>ans :
                break
        ans=min(ans,diff)
    return ans

print(solve())
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

MOD = 10 ** 9 + 7

N = int(readline())
A = np.array(read().split(),np.int64)

answer = 0
for n in range(63):
    B = (A >> n) & 1
    x = np.count_nonzero(B)
    y = N - x
    x *= y
    for _ in range(n):
        x *= 2
        x %= MOD
    answer += x
answer %= MOD
print(answer)
# Judge status: Wrong Answer
n = int(input())
p = list(map(int, input().split()))

count=0
for name, i in enumerate(p):
    try:
  	    if (p[name+1] > p[name] > p[name-1]) or (p[name-1] > p[name] > p[name+1]):
              count+=1
    except IndexError:
        continue
print(count)
# Judge status: Wrong Answer
N,K=map(int, input().split()) 

if N>K:
  y = int(N/K)
  x = N - y*K
else:
  x = N 
#print(x)
cnt = 0
ans = x
while cnt<10:
  x = abs(x-K)
  ans = min(ans, x)
  cnt += 1
ans = min(ans, 0)
print(ans)
# Judge status: Accepted
s = sorted(list(input()))
t = sorted(list(input()))[::-1]
print("Yes" if s < t else "No")
# Judge status: Wrong Answer
from sys import stdin
N, M = [int(_) for _ in stdin.readline().rstrip().split()]
PM = [stdin.readline().rstrip().split() for _ in range(M)]
AC = set()
WA = {}
for pm in PM:
    if pm[1] == "AC":
        AC.add(pm[0])
    elif pm[1] == "WA":
        if pm[0] in AC:
            continue
        if pm[0] not in WA:
            WA[pm[0]] = 0
        WA[pm[0]] += 1  
print(len(AC), sum(WA.values()))
# Judge status: Accepted
n,x0 = map(int,input().split( ))
*x_, = map(int,input().split( ))

x = [x_[i]-x0 for i in range(n)]

from fractions import gcd

g = x[0]

for i in range(1,n):
    g = gcd(g,x[i])
print(abs(g))
# Judge status: Accepted
n = [int(input()) for i in range(5)]
m = 10
x = n[0]
#1の位が最も小さいものはそのまま足す・残りは1の位を切り上げて足す

for i in n:
  if int(str(i)[-1]) < m and int(str(i)[-1]) > 0:
    m = int(str(i)[-1])
    x = i



n.remove(x)
    
for i in range(len(n)):
  if n[i]%10 != 0:
    n[i] = n[i] + 10 - int(str(n[i])[-1])

print(sum(n) + x)
# Judge status: Accepted
n = int(input())
num = 0
for i in range(1,n):#Aの数値
    num += ((n - 1) // i)
print(num)
# Judge status: Wrong Answer
n = int(input())
s = input()
s = s.lstrip('.')
s = s.lstrip('#')
print(min(s.count('.'), s.count('#')))
# Judge status: Wrong Answer
n = int(input())
if(n%2 == 0):print(n/2)
else:print(int(n/2)+1)
# Judge status: Accepted
x, y ,z = map(int, input().split())
print((x - z) // (y + z))
# Judge status: Accepted
n = int(input())
a = [0] * n
b = [0] * n
for i in range(n):
    atmp,btmp = (int(num) for num in input().split())
    a[i] = atmp
    b[i] = btmp
    
a.sort()
b.sort()
minval = 0
maxval = 0
ans = 0
if n % 2 == 0:
    minval = (a[n//2-1] + a[n//2]) / 2
    maxval = (b[n//2-1] + b[n//2]) / 2
    ans = int((maxval - minval) * 2 + 0.00001) + 1
else:
    minval = a[n//2]
    maxval = b[n//2]
    ans = maxval - minval + 1
    
print(ans)
# Judge status: Accepted
A, B, X = map(int, input().split())

if X < A or X > A+B:
    print('NO')
else:
    print('YES')
# Judge status: Accepted
S=input()
year=int(S[:4])
year+=1
print(str(year)+"/"+S[5:])
# Judge status: Accepted
n = int(input())
num_list = list(map(int,input().split()))
sum_cnt = sum(num_list)
sunuke = 0
arai = 0
tmp = 0
tmp_list = []
for i in range(len(num_list)-1):
    if i == 0:
        sunuke += num_list[i]
        arai = (sum_cnt - sunuke)
        tmp = abs(arai - sunuke)
        tmp_list.append(tmp)
    else:
        sunuke += num_list[i]
        arai = (sum_cnt - sunuke)
        tmp = abs(arai - sunuke)
        tmp_list.append(tmp)
print(min(tmp_list))
# Judge status: Wrong Answer
s=input()

l=len(s)
a=""
for i in range(l):
  a+"x"
  
  
print(a)
# Judge status: Wrong Answer
s = input()

a = [str(2019*i) for i in range(1,101)]
ans = 0
for i in a:
    if i in s:
        t = len(i)
        for j in range(len(s)-t+1):
            if s[j:j+t] == i:
                ans += 1

print(ans)
# Judge status: Accepted
A, B = map(int,input().split())
print((A+B)%24)
# Judge status: Wrong Answer
n,w = [int(x) for x in input().split(" ")]

dp = [0 for x in range(w+1)]
sf = [w]
ma = 0
for x in range(n):
    www,vvv = [int(x) for x in input().split(" ")]

    a =len(sf)
    for j in range(a):
        if sf[j]-www >= 0 and dp[sf[j]] + vvv > dp[sf[j]-www]:
            dp[sf[j]-www] = dp[sf[j]] + vvv
            sf.append(sf[j]-www)
            if dp[sf[j]] + vvv > ma:
                ma = dp[sf[j]] + vvv

print(ma)
# Judge status: Accepted
n, y = list(map(int, input().split()))

for i in range(n+1):
    for j in range(n+1):
        k = n-i-j
        if k>=0 and y == i*10000+j*5000+k*1000:
            print(i, j, k)
            exit()
print(-1, -1, -1)
# Judge status: Accepted
n, m = map(int, input().split())
a = [int(i) for i in input().split()]
ans = n - sum(a)
if ans >= 0:
    print(ans)
else:
    print(-1)
# Judge status: Accepted
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

x, y = map(int, input().split())

if x<y:
    diff = abs(abs(x)-abs(y))
    if x*y>=0:
        print(diff)
        exit()
    else:
        print(diff+1)
        exit()


if y<x:
    diff = abs(abs(x)-abs(y))
    if x*y>0:
        print(diff+2)
    else:
        print(diff+1)
# Judge status: Accepted
import sys

a,b=map(int,input().split())
c=b-a
ans=0
for i in range(1,c+1,1):
	ans+=i
ans-=b
print(ans)
# Judge status: Wrong Answer
a = map(int, input().split())
input_list = list(a)

group_a = [1, 3, 5, 7, 8, 10, 12]
group_b = [4, 6, 9, 11]
group_c = [2]
list_of_list = [group_a, group_b, group_c]

count_match = 0

for list_i in list_of_list:
    if input_list in list_i:
        count_match += 1
        break

if count_match == 1:
    print('Yes')
else:
    print('No')