peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
a=int(input())
i=100
f=0
while i/a<1:
  i=int(i*1.01)
  f=f+1
  if a/i>3605334940814628:
    i=int(i*3605334940814628)
    f=f+3600
print(f)
# Judge status: Accepted
N,M=map(int,input().split())
list = [int(i) for i in input().split()]
Sum=sum(list)

if(N-Sum < 0):
  print(-1)
else:
  print(N-Sum)
# Judge status: Accepted
def cmb(n,r):
  r=min(r,n-r)
  if r<0 or n<=0:
    return 0
  return A[n]*B[r]*B[n-r]%mod
mod=10**9+7
A=[1,1]
B=[1,1]
for i in range(2,7*10**5):
  A.append(A[-1]*i%mod)
  B.append(B[-1]*pow(i,mod-2,mod)%mod)
x,y=map(int,input().split())
if (x+y)%3==0:
  a=(x+y)//3
  b=x-a
  print(cmb(a,b))
else:
  print(0)
# Judge status: Wrong Answer
n, k = map(int, input().split())
a = list(map(int, input().split()))
low = 0
top = max(a) + 1

while top - low > 1:
  mid = (top + low) // 2
  cnt = 0
  for i in range(n):
    cnt += (a[i] + 1) // mid
  if cnt <= k:
    top = mid
  else:
    low = mid
print(low)
# Judge status: Wrong Answer
n, a, b = map(int, input().split())

if a > b:
    print(0)
elif n == 1 and a != b:
    print(0)
elif n != 1 and a == b:
    print(0)
else:
    print((b * (n-1) + a) - (a * (n-1) + b) + 1)
# Judge status: Wrong Answer
N = int(input())
L = list(map(int, input().split()))
L.sort()


ans = 0
flag = 0
ma = 2

for left1 in range(N-2):
    for left2 in range(left1+1, N-1):
        for right in range(ma, N):
            if L[right] < L[left1] + L[left2]:
                flag = 1
                ma = right
            if L[right] >= L[left1] + L[left2]:
                if flag == 1:
                    ans += right - left2
                break
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-

def main():
    N = int(input())
    A  = [int(i) for i in input().split()]
    ans = 0
    max = A[0]
    for a in A:
        if max > a:
            ans += max-a
        else:
            max = a
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import sys
n,m = map(int,input().split())
broken = []
for i in range(m):
  broken.append(int(input()))
  if(len(broken) >= 2):
    if(broken[i] - broken[i-1] == 1):
      print("0")
      sys.exit()
# Judge status: Accepted
x = int(input())
res = (x // 11) * 2
if 1 <= x % 11 <= 6:
    res += 1
elif 7 <= x % 11 <= 10:
    res += 2
print(res)
# Judge status: Accepted
from collections import Counter

s = input().rstrip()
t = input().rstrip()

if sorted(Counter(s).values()) == sorted(Counter(t).values()):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
a,b = map(int,input().split())
stg = input()
res = "Yes"
if len(stg)==a+b+1:
  for i in range(a):
    if not stg[i].isdigit():
      res = "No"
  if not stg[a]=='-':
    res = "No"
  for i in range(a+1,b+1):
    if not stg[i].isdigit():
      res = "No"
else:
  res = "No"
print(res)
# Judge status: Accepted
from collections import Counter
n = int(input())
a = list(map(int,input().strip().split()))
if Counter(a).most_common(1)[0][1] != 1:
    print('NO')
else:
    print('YES')
# Judge status: Accepted
import heapq
N,M=map(int,input().split())
arr=list(map(int,input().split()))
hq=[]
for i in arr:
    heapq.heappush(hq,-i)

while M>0:
    a=heapq.heappop(hq)    
    heapq.heappush(hq,a/2)
    M-=1
    #print(hq)
ans=0
for i in hq:    
    ans+=int(-i)
    
print(ans)
# Judge status: Accepted
k=int(input())
num=[]

def d(n):
  num.append(n)
  if n > 3234570000:
    return
  a=n%10
  if a==0:
    l=[0,1]
  elif a==9:
    l=[8,9]
  else:
    l=[a-1,a,a+1]
  for i in l:
    s=int(str(n)+str(i))
    d(s)

for i in range(1,10):
  d(i)

num.sort()
print(num[k-1])
# Judge status: Accepted
n=int(input())
A=[]
for i in range(n):
  A.append(int(input()))
k=1
for i in range(n):
  if A[k-1]==2:
    print(i+1)
    exit()
  k=A[k-1]
print(-1)
# Judge status: Accepted
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,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()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

s = input()
n = len(s)
if n %2: print('No'); quit()
for i in range(n//2)[::2]:
    if s[i] == 'h' and s[i+1] == 'i':
        continue
    print('No')
    quit()
print('Yes')
# Judge status: Wrong Answer
N = int(input())
L = list(map(int, input().split()))
L.sort(reverse=True)
if 2*max(L) > sum(L):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import math

L = int(input())

ans = 0
for x in range(math.floor(L/3)-1, math.ceil(L/3)+1):
    for y in range(math.floor(L/3)-1, math.ceil(L/3)+1):
        for z in range(math.floor(L/3)-1, math.ceil(L/3)+1):
            if x+y+z == L:
                tmp = x*y*z
                ans = max(ans, tmp)
print(float(ans))
# Judge status: Accepted
N=int(input())
D=list(map(int,input().split()))
layer=[0]*N

mx=0
for item in D:
    layer[item]+=1
    mx=max(mx,item)

if layer[0]!=1 or D[0]!=0:
    print(0)
    exit()

ans=1
for i in range(mx):
    ans*=(layer[i]**layer[i+1])

print(ans%998244353)
# Judge status: Wrong Answer
import string
import collections
ans=[]
a,b = map(int, input().split())
for i in range(2, int(min(a,b)**0.5)+1):
  if max(a,b)%i == 0 and min(a,b)%i == 0:
    for j in ans:
      if i%j == 0:
        break
    else:
      ans+=[i]
print(len(ans)+1)
# Judge status: Accepted
#!/usr/bin/env python3

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

seen = {}


def luka(n):
    if n == 0:
        return 2
    if n == 1:
        return 1

    if n in seen.keys():
        return seen[n]
    else:
        seen[n] = luka(n-1) + luka(n-2)
        return seen[n]


N = int(input())
print(luka(N))
# Judge status: Wrong Answer
N,M=list(map(int,input().split()))
A=[list(map(int,input().split())) for i in range(M)]
import sys
S=[-1 for i in range(N)]
visited=[[] for i in range(N)]

for i in A:
    S[i[0]-1]=i[1]
    visited[i[0]-1].append(i[1])
for i in visited:
    if len(set(i))>1:
        print(-1)
        sys.exit()
if S[0]==0:
    print(-1)
    sys.exit()
if S[0]==-1:
    S[0]=1

for i,value in enumerate(S):
    if value==-1:
        S[i]=0

print(*S,sep='')
# Judge status: Accepted
n,h=map(int,input().split())
g=[[0]*2 for i in range(n)]
for i in range(n):
  g[i]=list(map(int,input().split()))
a=0
for i in range(n):
  if g[i][0]>a:
    a=g[i][0]
g.sort(key=lambda x:x[1],reverse=True)
ans=0
i=0
while h>0 and i<n:
  if g[i][1]<a:
    break
  h=h-g[i][1]
  ans=ans+1
  i=i+1
if h<=0:
  print(ans)
else:
  ans=ans+((h-1)//a+1)
  print(ans)
# Judge status: Accepted
n = int(input())
d = [int(i) for i in input().split()]

ans = 0
d.sort()

abc = d[0:n//2]
arc = d[n//2:n]
if len(abc) == len(arc):
	ans = d[n//2] - d[n//2-1] 
print(ans)
# Judge status: Accepted
N, A, B = map(int, input().split())
if N == 1 and A != B:
    print(0)
    exit()
elif N == 1:
    print(1)
    exit()
elif A > B:
    print(0)
    exit()
elif A == B:
    print(1)
    exit()

am = N - 2
# 最小
minv = A + B + am*A
# 最大
maxv = A + B + am*B
print(maxv - minv + 1)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

souwa = 0
cnt = 0
keep = 1e10

for i in range(N):
    if A[i] < 0:
        cnt += 1
        A[i] *= (-1)

    souwa += A[i]
    keep = min(keep, A[i])

print(souwa - 2 * keep * (cnt % 2))
# Judge status: Accepted
S = list(input())
flag = True

if len(S) % 2 == 0:
  for i in range(0, len(S), 2):
    if S[i] == 'h' and S[i + 1] == 'i':
      pass
    else:
      flag = not flag
      break
else:
  flag = not flag

if flag:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N = int(input())
def Main(N):
    return 800*N-200*(N//15)
    
print(Main(N))
# Judge status: Accepted
N, L = map(int, input().split())
l = [input() for _ in range(N)]
l = sorted(l)
s = ""
for i in range(N):
  s += l[i]
print(s)
# Judge status: Accepted
a=list(map(int,input().split()))
if sum(a)<22:
	print('win')
else:
	print('bust')
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
if a <= c <= b:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
import sys

input = sys.stdin.readline

def main():
    ans = ''
    index = 0
    s = input().rstrip('\n')
    k = int(input())
    for i in range(len(s)):
        if s[i] != '1':
            ans = s[i]
            index = i
            break
    if ans == '' or k < index+1:
        ans = '1'
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
x = 800 * N
y = 200 * (N // 15)
print(x - y)
# Judge status: Accepted
import sys
S=input()
first=S[0]
second=S[1]
last=S[len(S)-1]
cnt=0
moji=[i for i in "abcdefghijklmnopqrstuvwxyz"]
# print(len(moji))

if first=="A":
  for i in range(2,len(S)-1):
  
    if S[i]=="C":
      cnt+=1
    else:
      if (S[i] in moji)==False:
        print("WA")
        sys.exit()

  if cnt==1 and ((last in moji)==True) and ((second in moji)==True):
    print("AC")
  else:
    print("WA")
        
else:
  print("WA")
# Judge status: Accepted
h,n=map(int,input().split())
a=list(map(int,input().split()))
print("Yes" if sum(a)>=h else "No")
# Judge status: Wrong Answer
def main():
    n = int(input())
    w = list(map(int, input().split()))

    avr = sum(w) // 2
    res = 0
    ans1 = 0
    ans2 = 0    
    for i in range(n):
        res += w[i]
        if res > avr:
            ans1 = abs(sum(w[(i+1):]) - sum(w[:(i+1)]))
            ans2 = abs(sum(w[i+1:]) - sum(w[:i+1]))
            print(min(ans1,ans2))
            return


if __name__ == '__main__':
    main()
# Judge status: Accepted
n=int(input())

A=[]
B=[]

for i in range(n):
    ai,bi=map(int,input().split())
    A.append(ai)
    B.append(bi)

A.sort()
B.sort()

amid=0
bmid=0
if n%2==0:
    amid=(A[round(n/2-1)]+A[round(n/2)])/2
    bmid=(B[round(n/2-1)]+B[round(n/2)])/2
else:
    amid=A[round((n-1)/2)]
    bmid=B[round((n-1)/2)]

d=bmid-amid

if n%2==0:
    print(round(2*d)+1)
else:
    print(d+1)
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
tmp=A[0]
ans=1000
kabu=0
for i in range(1,N):
    if tmp < A[i]:
        kabu=ans//tmp
        ans=ans%tmp
        tmp=A[i]
    elif tmp > A[i]:
        ans+=kabu*tmp
        kabu=0
        tmp=A[i]
if kabu > 0:
    ans+=kabu*A[-1]
print(ans)
# Judge status: Accepted
from collections import Counter

N = int(input())
S = [input() for _ in range(N)]

A = Counter(list(S[0]))
for i in range(1, len(S)):
    B = Counter(list(S[i]))
    A &= B

ans = list(A.elements())
ans.sort()
print(''.join(ans))
# Judge status: Wrong Answer
N,K = map(int,input().split())
R,S,P = map(int,input().split())
T = str(input())
i = 0
point = 0
for i in range(N):
  if T[i] == "r" and T[K] != "p":
    point += P
  elif T[i] == "s" and T[K] != "r":
    point += R
  elif T[i] == "p" and T[K] != "s":
    point += S
  else:
    break
  i += 1
print(point)
# Judge status: Accepted
# -*- coding: utf-8 -*-

def main():
    s = str(input())

    if s == "RRR":
        print(3)
    elif s == "RRS" or s == "SRR":
        print(2)
    elif s == "SSS":
        print(0)
    else:
        print(1)

if __name__ == '__main__':
    main()
# Judge status: Accepted
n, k = map(int, input().split())
for x in range(n+1):
    for y in range(n+1):
        if x + y <= n:
            z = n - x - y
            result = 10000*x + 5000*y + 1000*z
            if result == k:
                print("{} {} {}".format(x, y, z))
                exit()
print("-1 -1 -1")
# Judge status: Wrong Answer
import sys
X,A,B = map(int,input().split())
if X < 0 or A < 0 or B < 0 or X > 10 ** 9 or A > 10 ** 9 or B > 10 ** 9:
    sys.exit()

if B - A <= X + 1 and B - X > 0:
    print("safe")
if B - A <= X + 1 and B - X < 0:
    print("delicious")
if B - A > X + 1:
    print("dangerous")
# Judge status: Wrong Answer
import numpy as np
Debug = False
# Calculate intensity
N, K = [int(v) for v in input().split(" ")]
A_arr = [int(v) for v in input().split(" ")]
def Luminate(A_arr, i):
  step = np.arange(len(A_arr))
  distance = abs(step - i)
  isLuminated = distance < np.array(A_arr)+1
  if Debug:
    print(step, distance,isLuminated)
  return isLuminated
def get_Intensity(A_arr):
  return [np.sum(Luminate(A_arr, i)) for i in range(len(A_arr))]
Intensity = A_arr
for i in range(K):
  Intensity = get_Intensity(Intensity)
print(Intensity)
# Judge status: Accepted
import sys
n, k = map(int, input().split())

n = abs(n - k)

if k == n:
    print(0)
    sys.exit()
elif k > n:
    print(min(n, k-n))
    sys.exit()
else:
    while n > k:
        n %= k
    print(min(n%k, abs(n-k)))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
bottom = sum(A)
 
if bottom == 0 or A[0] >= 1:
  print(-1)
  exit()
 
ret = 1
children = 1 - A[0]
bottom -= A[0]
 
for i in range(N):
    children = children * 2 - A[i+1]
    if children <= -1:
      ret = -1
      break
    
    bottom -= A[i+1]
    if children >= bottom:
      children = bottom
    ret += children + A[i+1]
print(ret)
# Judge status: Accepted
#!/usr/bin/env python3
import sys


def solve(A: int, B: int):
    print(A * B)
    return


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

if __name__ == '__main__':
    main()
# Judge status: Accepted
dct = {
    'AC': 0,
    'WA': 0,
    'TLE': 0,
    'RE': 0,
}
N = int(input())
for i in range(N):
    S = input()
    dct[S] = dct[S] + 1

print('AC x %s' % dct['AC'])
print('WA x %s' % dct['WA'])
print('TLE x %s' % dct['TLE'])
print('RE x %s' % dct['RE'])
# Judge status: Accepted
k = int(input())
a, b = map(int, input().split())

for i in range(1000):
    if a <= k*i <= b:
        print("OK")
        break
else:
    print("NG")
# Judge status: Wrong Answer
l=input()

if l=='a' or 'e' or 'i' or 'o' or 'u':
  print('vowel')
else:
  print('consonant')
# Judge status: Accepted
import numpy as np
n = int(input())
t, a = map(int, input().split())
h = np.array(list(map(int, input().split())))
temp = abs((t - 0.006 * h) - a)
ans = np.where(min(temp) == temp)
print(ans[0][0] + 1)
# Judge status: Wrong Answer
#!/usr/bin/env python


n, x, y = (int(v) for v in input().split())
x -= 1
y -= 1
c = [0] * (n - 1)
for i in range(n):
    c.append(n - i)
for i in range(n):
    for j in range(n):
        idx = min(
            abs(i - j),
            abs(i - x) + 1 + abs(j - y),
            abs(i - y) + 1 + abs(j - x)
        )
        c[idx - 1]
for v in c:
    print(str(int(v)))
# Judge status: Wrong Answer
N, K = map(int,input().split())
H = list(map(int,input().split()))
s = {}
for j in range(K):
  A, B = map(int,input().split())
  if H[A-1] < H[B-1]:
    s[A] = False
    s[B] = True
  else:
    s[A] = True
    s[B] = False
    
cnt = 0
for i in s:
  if s[i]:
    cnt += 1
print(cnt)
# Judge status: Accepted
O = input()
E = input()

len_pass = len(O) + len(E)
for num in range(1, len_pass + 1):
  if (num % 2 == 1):
    odd_index = num // 2
    print(O[odd_index], end="")
  elif (num % 2 == 0):
    even_index = (num // 2) - 1
    print(E[odd_index], end="")
print("")
# Judge status: Accepted
s = int(''.join(input().split()))
print('YES' if s%4==0 else 'NO')
# Judge status: Wrong Answer
a,b,c = map(int, input().split())

if c>=a and c<=b:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
N,K = map(int,input().split())
lis = []
for k in range(K,N+2):
    lis.append((N-k+1)*k+1)

print(sum(lis)%(10**9+7))
# Judge status: Accepted
n,x = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
for i in range(1,n):
    if a[i] + a[i-1] > x:
        t = a[i] + a[i-1] - x
        ans += t
        if a[i] >= t:
            a[i] = a[i] - t
        else:
            a[i-1] -= (t-a[i])
            a[i] = 0
print(ans)
# Judge status: Wrong Answer
a, b, t = map(int, input().split())
print((t+0.5)//a*b)
# Judge status: Accepted
x,y=map(int,input().split())
ans=1
while x*2 <= y:
    ans= ans+1
    x=x*2
print(ans)
# Judge status: Wrong Answer
N=int(input())
A=[]
for i in range(N):
  A.append(input())
K=int(input())

for i in range(K):
  s=input()
  if s in A==1:
    A.remove(s)
B=set(A)
ans=0
for i in B:
  if A.count(i)>ans:
    ans=A.count(i)
print(ans)
# Judge status: Accepted
n,a,b = map(int,input().split())
s = input()
count_a = 0
count_b = 0
for i in range(n):
  s1 = s[i]
  if s1 == "c":
    print("No")
  elif s1 == "b":
    if count_a + count_b < a+b and count_b < b:
      count_b += 1
      print("Yes")
    else:
      print("No")
  else:
    if count_a + count_b < a+b:
      count_a += 1
      print("Yes")
    else:
      print("No")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
A = [0]*(n)
num = 1e9+7
ans = 0
for i in range(1, n):
    A[i] = A[i-1] + a[i-1]
for i in range(n-1, 0, -1):
    ans += (A[i]*a[i])%num
    ans = ans%num
print(int(ans))
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    S = rl().rstrip()
    T = rl().rstrip()
    
    ans = 0
    for si, ti in zip(S, T):
        if si != ti:
            ans += 1
    print(ans)


if __name__ == '__main__':
    solve()
# Judge status: Accepted
import sys,math
input = sys.stdin.readline

a_max=0
b = []
N,H = map(int,input().split())
for i in range(N):
    an,bn = map(int,input().split())
    b.append(bn)
    a_max = max(a_max,an)

b = sorted([ bn for bn in b if bn>=a_max])
cnt = 0
for i in range(len(b)):
    H -= b.pop()
    cnt += 1
    if H <=0:
        print(cnt)
        exit()

cnt += math.ceil(H/a_max)
print(cnt)
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**6)
a = int(input())
S = 'abcdefghij'

def dfs(s,c):
    if c == a:
        ans.append(s)
        return 
    for i in S[:c+1]:
        if i in s:dfs(s+i,c+1)
        else:
            dfs(s+i,c+1)
            return 
ans = []

dfs("",0)

for i in ans:
    print(i)
# Judge status: Wrong Answer
a,b = map(int,input().split())
A = int((a+b)/2)
print(A if (A*10)%2 == 0 else int(A+0.5))
# Judge status: Wrong Answer
a, b = input(), input()
n = len(a)
if a==b[:n] and n+1==len(b):
    print("Yes")
else:
    print("NO")
# Judge status: Wrong Answer
ais = [int(raw_input()) for oo in range(int(raw_input()))]
seen = set([])
u = 0
while(u!= 1 or u not in seen):
	seen.add(u)
	u = ais[u] - 1

print len(seen) if u == 1 else -1
# Judge status: Wrong Answer
n = int(input())

ans = 0

i = 2
num = n
while i * i <= n:
  cnta = 0
  cntb = 0
  while num % i == 0:
    num //= i
    if cnta == cntb:
      ans += 1
      cnta = 0
      cntb += 1
    else:
      cnta += 1
  i += 1
  
if ans == 0 and n != 1:
  ans += 1
print(ans)
# Judge status: Accepted
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
INF = 10**18


if __name__ == "__main__":
    c = list(input())
    t = list(input())
    for i in range(len(c)):
        if c[i] != t[len(t)-i-1]:
            print("NO")
            sys.exit()
    print("YES")
# Judge status: Accepted
O=list(input())
E=list(input())
ans=""
if len(O)-len(E) > 0:
    ans+=O[0]
    O.pop(0)
    for i in range(len(O)):
        ans+=E[i]
        ans+=O[i]
else:
    for i in range(len(O)):
        ans+=O[i]
        ans+=E[i]
print(ans)
# Judge status: Accepted
S = input()
T = input()

def rolling(str , n):
    return str[n:len(str)] + str[:n]

for i in range(len(S)):
    if T == rolling(S, i):
        print('Yes')
        exit()

print('No')
# Judge status: Accepted
N = int(input())
num = range(1,10)
num_list = [ i*j   for i in num for j in num ]
if N in num_list:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n,m,x= map(int,input().split())
texts = [list(map(int,input().split())) for i in range(n)]
judge = False
min_ex = 10**7

for bit in range(2**n):
    understand = [0]*m
    expense = 0
    for i in range(n):
        if bit>>i & 1:
            expense += texts[i][0]
            for j in range(m):
                understand[j] += texts[i][j+1]
    if min(understand) >= x:
        judge = True
        min_ex = min(expense, min_ex)

if judge:
    print(min_ex)
else:
    print(-1)
# Judge status: Wrong Answer
K = int(input())
S = input()
if len(S) >= K:
  print(S)
else:
  print(S[:K]+'...')
# Judge status: Accepted
from math import ceil

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

print(4+ceil(N/min(A,B,C,D,E)))
# Judge status: Wrong Answer
n, m = map(int, input().split())
a = list(map(int, input().split()))

a.sort(reverse = True)

for i in range(m):
    a[0] = a[0] // 2
    if sum(a) == 0:
        break
    for j in range(n):
        if a[0] < a[j]:
            a[0], a[j] = a[j], a[0]
            break
print(sum(a))
# Judge status: Accepted
N=int(input())
print(N//2 if N%2==0 else N//2+1)
# Judge status: Accepted
N = int(input())
n, p, score = N, 2, 0
while p ** 2 <= N:
  e = 1
  while n >= (p ** e) and n % (p ** e) == 0:
    n //= (p ** e)
    score += 1
    e += 1
  else:
    while n >= p and n % p == 0:
      n //= p
    p += 1
else:
  if n != 1:
    score += 1
print(score)
# Judge status: Accepted
l, r, d = map(int, input().split())

cnt = 0
for i in range(l, r+1):
    if i % d == 0:
        cnt += 1
print(cnt)
# Judge status: Accepted
A,B,C = list(map(int,input().split()))
if A%2==0 or B%2==0 or C%2==0:
    print(0)
    exit()
print(min(A*B,B*C,C*A))
# Judge status: Wrong Answer
n = int(input())
a = [int(i) for i in input().split()]
x=0
k=sum(a)
m = 3*10**5
if sum(a)==0 and n>2:
  print(0)
  exit()
for i in range(n-1):
  x+=a[i]
  if m>abs(2*x-k):
    m=abs(2*x-k)
print(m)
# Judge status: Accepted
N,C,K = map(int,input().split())
T = [int(input()) for _ in range(N)]
T.sort()
bus = 0
count = 0
j = 0
for i in range(N-1):
  count += 1
  if count >= C or T[i+1] > T[j]+K:
    bus += 1
    j += count
    count = 0
  if i == N-2:
    count += 1
    if count%C == 0:
      bus += count//C
    else:
      bus += count//C+1
print(bus)
# Judge status: Accepted
a, b, x = map(int, input().split())
if a%x == 0:
  ans = (b-a)//x+1
else:
  a += x-a%x
  if b >= a:
    ans = (b-a)//x+1
  else:
    ans = 0
print(ans)
# Judge status: Wrong Answer
N = int(input())
An = [int(x) for x in input().split()]  
 
# ボールを全部使えるときの合計を求める
s = 0
for i in range(1,N+1):
    b = An.count(i)
    if b > 1:
        s += b*(b-1) / 2

for k in range(N):
    print(s - (An.count(An[k])-1))
# Judge status: Accepted
X = input()
stack = []
for x in X:
    if stack and stack[-1] == "S" and x == "T":
        stack.pop()
    else:
        stack.append(x)
print(len(stack))
# Judge status: Accepted
w, h, n = map(int, input().split())
l = 0
r = w
u = h
d = 0
for i in range(n):
  x, y, a = map(int, input().split())
  if a == 1:
    l = max(l,x)
  elif a == 2:
    r = min(r,x)
  elif a == 3:
    d = max(d,y)
  elif a == 4:
    u = min(u,y)
print(max(r-l,0)*max(u-d,0))
# 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: Accepted
from itertools import combinations
n,m,x = map(int, input().split())
ca = [list(map(int, input().split())) for _ in range(n)]

ans = float("inf")
for i in range(1, n+1):
  for i1 in combinations(ca, i):
    nums = [0]*(m+1)
    for i2 in i1:
      for i3 in range(m+1): nums[i3] += i2[i3]
    if min(nums[1:]) >= x:
      if nums[0] < ans: ans = nums[0]
if ans == float("inf"): print(-1)
else: print(ans)
# Judge status: Wrong Answer
[n,m]=list(map(int,input().split()))
if m-2*n>=0:
    ans=n+(m-2*n)//4
else:
    ans=n//2
print(ans)
# Judge status: Wrong Answer
n = int(input())
s = str(input())
t = str(input())

if s == t:
  print(n)
  exit()

s = ''.join(list(reversed(s)))

ans = 2*n
for i in range(n):
  if s[i] == t[i]:
    ans -= 1
  else:
    break
print(ans)