peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
# E - Logs
import sys
sys.setrecursionlimit(1000000)

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

def rec(l,r):
    global N,K,A
    if l==r:
        return l
    tmp = (l+r)//2
    ans = 0
    for i in range(N):
        ans += (A[i]-0.001)//tmp
    if ans<=K:
        return rec(l,tmp)
    else:
        return rec(tmp+1,r)
    
print(rec(1,max(A)))
# Judge status: Accepted
S=input()
T=""
U=""
K=0
for s in S:
    U+=s
    if T!=U:
        K+=1
        T=U
        U=""

print(K)
# Judge status: Wrong Answer
n = int(input())
ac_c = 0
wa_c = 0
tle_c = 0
re_c = 0
for i in range(n):
    s = input()
    if s == "AC":
        ac_c += 1
    elif s == "WA":
        wa_c += 1
    elif s == "TLE":
        tle_c += 1
    else:
        re_c +=1
print("AC" + "x" + str(ac_c))
print("WA" +"x"+ str(wa_c))
print("TLE"+ "x"+ str(tle_c))
print("RE" + "x"+ str(re_c))
# Judge status: Wrong Answer
n,m = map(int,input().split())
a = []
b = []
for _ in range(n):
  a.append(input())
for _ in range(m):
  b.append(input())
for i in range(n-m+1):
  if b[i] in a[i]:
    for x in range(m-1):
      if b[i+x] not in a[i+x]:
        print("No")
        exit()
      else:
        print("Yes")
        exit()
  else:
    print("No")
    exit()
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

N=int(input())
a=list(map(int,input().split()))
a.sort()
print(sum(a[N:2*N]))
# Judge status: Accepted
#!/usr/bin/env python3
import math


def main():
    a, b, x = map(int, input().split())

    if a * a * b / 2 <= x:
        ans = math.atan(2 * (a * a * b - x) / (a * a * a))
    else:
        ans = math.pi / 2 - math.atan(2 * x / (a * b * b))

    print(math.degrees(ans))


if __name__ == "__main__":
    main()
# Judge status: Accepted
d,n = map(int,input().split())
a = list(map(int,input().split()))
print(max(-1,d-sum(a)))
# Judge status: Accepted
import math
from decimal import Decimal
A,B=list(input().split())
A = Decimal(A)
B = Decimal(B)
# print(A* B)
print(int(A  * B ))
# Judge status: Wrong Answer
import numpy as np

S = str(input())

import numpy as np

for i in range(int(np.floor(len(S)/2))):
    j = int(np.floor(len(S)/2)) - i
    first_str = S[:j]
    second_str = S[j:2*j]
    if first_str == second_str:
        num = 2*j
        break

print(num)
# Judge status: Accepted
N = int(input())
A = []
A = input().split()
A = [int(i) for i in A]

#print('N = ', N)
#print('A = ', A)

A.sort()
#print('sortA = ', A)

count = 0

for i in range(N-1):
  if A[i] == A[i+1]:
    count += 1
    break

if count > 0:
  print('NO')
else:
  print('YES')
# Judge status: Accepted
import fractions
A,B = map(int,input().split())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

n = fractions.gcd(A,B)
print(len(set(prime_factorize(n)))+1)
# Judge status: Wrong Answer
N = int(input())
A_list = [int(item)-(index+1) for index, item in enumerate(input().split())]

b = sum(A_list)//len(A_list)

ans = 0
for i in A_list:
  ans += abs(i-b)

print(ans)
# 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


import numpy as np

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

    va = np.array(A)
    vb = np.array(A[1:] + [A[0] + K])

    vv = vb - va

    print(K - max(vv))


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n = int(input())
a = input().split(" ")

flag = False
for i in range(n-1):
    for j in range(i, n):
        if a[i] == a[j]:
            Flag = True
            break
    if flag:
        break

print('NO' if flag else 'YES')
# Judge status: Accepted
x = int(input())
if x==1:
    print(1)
else:
    for i in range(2, x+1):
        if i*(i-1)/2<x<=(i+1)*i/2:
            print(i)
            break
# Judge status: Accepted
N = input()
ans = 0
for n in N:
    ans += int(n)
    ans %= 9
if ans % 9 == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys
N = int(sys.stdin.readline())
A = [int(sys.stdin.readline()) for _ in range(N)]
ans = 0
for i in range(1, N):
    ans += (A[i - 1] + A[i]) >> 1
    if A[i]:
        A[i] = (A[i - 1] + A[i]) & 1
print(A[0] >> 1 if N == 1 else ans)
# Judge status: Wrong Answer
s = input()
u = ['dreamer', 'eraser', 'dream', 'erase']
while len(s) > 0:
    for i in u:
        if s[-len(i):-0] == i:
            s = s.rstrip(i)
            break
    else:
        print('No')
        exit()
else:
    print("YES")
# Judge status: Wrong Answer
animals = input()
S = animals[0]
W = animals[1]
if(W >= S): print('unsafe')
else: print('safe')
# Judge status: Wrong Answer
N, D = map(int, input().split())
zahyo = [0]*N
for i in range(N):
  zahyo[i] = list(map(int, input().split()))
count = 0
for i in range(N):
  for j in range(i+1, N):
    V = 0
    for k in range(D):
      V += float((zahyo[i][k]-zahyo[j][k])**2)
    if V.is_integer():
      count += 1
print(count)
# Judge status: Accepted
import sys
a1 = []
for l in sys.stdin:
    a1.append(int(l))
n , a = tuple(a1)
if n % 500 <= a:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
import sys; sys.setrecursionlimit(2147483647); input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log
from collections import Counter, defaultdict
from operator import itemgetter
INF = float('inf'); MOD = 10**9+7
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(MI())
def LIR(n): return [LI() for i in range(n)]
def S(): return input().rstrip()

def main():
    N, A, B = MI()
    if A != 0:
        print(N-pow(10, 100, A+B))
    else:
        print(0)
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n,m=[int(x) for x in input().rstrip().split()]
ans=0
m-=n*2
ans+=n
ans+=m//4
print(ans)
# Judge status: Accepted
import sys
input = sys.stdin.readline
N = int(input())
table = [0] * 26
mx = 0
a = ord("a")
for c in input()[: -1]:
  table[ord(c) - a] += 1
#print(table)
for _ in range(N - 1):
  s = list(input())[: -1]
  for t in range(26):
    table[t] = min(table[t], s.count(chr(t + a)))

res = []
for c in range(26):
  if table[c]:
    res += [chr(a + c)] * table[c]
print("".join(res))
# Judge status: Accepted
s = input()
t = input()

ss = s+s
l = len(t)

for i in range(l):
  if ss[i:i+l] == t:
    print('Yes')
    break
else:
  print('No')
# Judge status: Accepted
import sys
input = sys.stdin.buffer.readline
from bisect import bisect_right
N = int(input())
li_a = []
for _ in range(N):
    a = int(input())
    li_a.append(a)
INF = 10**15
dp = [INF]* N
for i in range(N-1, -1, -1):
    a = li_a[i]
    k = bisect_right(dp, a)
    dp[k] = a
check = INF-1
print(bisect_right(dp, check))
# Judge status: Accepted
s=input()
print("2018"+s[4:])
# Judge status: Accepted
import heapq

n, m = map(int, input().split())
pay = sorted([[-int(i) for i in input().split()] for _ in range(n)])

res = 0
pq = []
for i in range(1, m+1):
    while pay and -pay[-1][0] <= i:
        a, b = pay.pop()
        heapq.heappush(pq, b)
    if pq:
        res -= heapq.heappop(pq)

print(res)
# Judge status: Wrong Answer
x = int(input())

q = x // 100
r = x % 100

if 0 <= q and q <= 5*r:
  print(1)
else:
  print(0)
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))

ans  = 0
for i in range(N):
    if i%2 == 0:
        continue
    if a[i]%2 == 0:
        continue
    ans += 1

print(ans)
# Judge status: Wrong Answer
a = input()
if a=="AAA" or "BBB":
  print("No")
else:
  print("Yes")
# Judge status: Accepted
from collections import Counter
_, *lst = map(int, open(0).read().split())
c = Counter(lst).items()
stick2 = [i for i, j in c if j > 1]
stick4 = [0] + [i for i, j in c if j > 3]
max4 = max(stick4)
max4 *= max4
if len(stick2) > 1:
  stick2.sort()
  print(max(stick2[-1] * stick2[-2], max4))
else:
  print(max(0, max4))
# Judge status: Wrong Answer
def gcd2(a, b):
    if b == 0:
        return a
    return gcd2(b, a % b)

def gcd3(a, b, c):
    z = gcd2(a, b)
    return(gcd2(c, z))

k = int(input())
t = 0
for a in range(1, k + 1):
    for b in range(a, k + 1):
        for c in range(b, k + 1):
            t += gcd3(a, b, c)
print(t)
# Judge status: Accepted
def main():
  N = int(input())
  A = list(map(int, input().split()))

  X = A[0]

  for i in range(1, N):
    X = X ^ A[i]

  B = []

  for v in A:
    B.append(X ^ v)
  
  print(" ".join(map(str, B)))

if __name__ == "__main__":
  main()
# Judge status: Accepted
a,b = map(int,input().split())

if a>0:
    print("Positive")
elif b >= 0 >= a:
    print("Zero")
elif (b-a+1)%2==0:
    print("Positive")
else:
    print("Negative")
# Judge status: Accepted
N = int(input())
B = list(map(int, input().split()))

A = []
A.append(B[0])
for i in range(0, N-2):
  if B[i] < B[i+1]:
    A.append(B[i])
  else:
    A.append(B[i+1])
A.append(B[N-2])
print(sum(A))
# Judge status: Accepted
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rf = lambda: map(float, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, b, c = rm()
if a<c<b or a>c>b:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n = int(input())
ll = [[] for _ in range(n+1)]

count = 1
for i in range(n):
    ll[0].append(int(input()))
    ll[count] = ll[0].copy()
    ll[count][count-1] = 0
    max = 0
    for j in ll[count]:
        if j>max:
            max = j
        else:
            pass
    print(max)
    count+=1
# Judge status: Wrong Answer
Q, H, S, D = map(int, input().split())
N = int(input())

cQ = Q*4
cH = H*2
cS = S
cD = D / 2

m = min(cQ, cH, cS, cD)

if m == cQ:
    print(cQ * N)
elif m == cH:
    print(cH * N)
elif m == cS:
    print(cS * N)
else:
    if N % 2 == 0:
        print(D * N // 2)
    elif N == 1:
        print(min(cQ, cH, cS))
    else:
        c = (N-1)*cD
        print(c + min(cQ, cH, cS))
# Judge status: Accepted
import math
n=int(input())
x0 = n * 100 / 108
x1 = (n+1) * 100 / 108

if x0.is_integer():
    print(math.floor(x0))
elif x1.is_integer():
    print(':(')
elif math.floor(x0) != math.floor(x1):
    print(math.floor(x1))
else:
    print(':(')
# Judge status: Wrong Answer
N, M = map(int, input().split())
A = list(map(int, input().split()))
vote = sum(A)
cnt = 0

print(N, M)
print(A)

for i in range(N):
  if A[i] >= vote / 4 / M:
    cnt += 1
  else:
    continue

if cnt >= M:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
x = list(map(int, input().split()))

print(x.index(0)+1)
# Judge status: Accepted
# B - String Rotation
from collections import deque

S = deque(str(input()))
T = deque(str(input()))
N = len(S)
ans = 'No'

for _ in range(N):
    S.append(S.popleft())
    if S == T:
        ans = 'Yes'

print(ans)
# Judge status: Accepted
X,Y = map(int,input().split())
print(X + Y//2)
# Judge status: Accepted
a, b = map(int, input().split())
x = 0
y = 1
while y < b:
    y += (a - 1)
    x += 1

print(x)
# Judge status: Accepted
S, T = input().split()
A, B = map(int, input().split())
U = input()

if U == S:
    A -= 1
elif U == T:
    B -= 1
print("{} {}".format(A, B))
# Judge status: Wrong Answer
n = int(input())
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
r = A1[0]+A2[-1]
for i in range(1, n-1):
    r += A1[i]
    if sum(A1[i+1:]) < sum(A2[i:-1]):
        r += sum(A2[i:-1])
        break
    if i == n-2:
        r += A1[-1]
print(r)
# Judge status: Wrong Answer
a,b,c = map(int, input().split())

s = a+b+c
cnt = 0
while True:
    s += 2
    cnt += 1
    if s%3==0:
        if s//3 >= a and s//3 >= b and s//3>= c:
            break
print(cnt)
# Judge status: Wrong Answer
num_list = list(map(int, input().split()))
k = int(input())

tmp_lists = []
for i in range(3):
    ans_lists = num_list.copy()
    ans_lists[i] = num_list[i]*(2**k)
    tmp_lists.append(ans_lists)

max = 0

for list in tmp_lists:
    sum = 0
    for k in list:
        sum += k
    if max < sum:
        max = sum

print(sum)
# Judge status: Wrong Answer
X=int(input())
import math
print(math.floor(math.pow(X,0.5))**2)
# Judge status: Accepted
N,M=map(int,input().split())
if M==1:
  if N==1:
    print(1)
  elif N==2:
    print(0)
  else:
    print(N-2)
elif M==2:
  print(0)
else:
  if N==1:
    print(M-2)
  elif N==2:
    print(0)
  else:
    print((M-2)*(N-2))
# Judge status: Accepted
n=int(input())
sum=0
for i in range(1,n+1):
  if i%3!=0 and i%5!=0:
    sum+=i
print(sum)
# Judge status: Accepted
n = int(input())
w = tuple(map(int, input().split()))
av_min = 100000
for i in range(n-1):
    av = abs(sum(w[:i+1]) - sum(w[i+1:]))
    if av < av_min:
        av_min = av
    else:
        break
print(av_min)
# Judge status: Accepted
x = int(input())

for i in range(1, x + 1):
    if i * (i + 1) / 2 >= x:
        print(i)
        break
# Judge status: Accepted
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = list(input())
hands = {'r': 'p', 'p':'s', 's': 'r'}

ans = 0
h = []
for i in range(N):
    e = T[i]
    if i >= K and h[i-K] == hands[e]:
        h.append(None)
        continue

    if e == 'r':
        h.append('p')
        ans += P
    elif e == 'p':
        h.append('s')
        ans += S
    elif e == 's':
        h.append('r')
        ans += R

print(ans)
# Judge status: Accepted
import math
h, w = list(map(int,input().split()))
if h != 1 and w != 1:
	print(math.ceil((h*w)/2))
else:
	print(1)
# Judge status: Wrong Answer
N,A,B,C,D = map(int,input().split())
S = ['#']+list(input())
CanReach = True
CanChange = False
for i in range(A,C):
    if S[i] == '#' and S[i+1] == '#':
        CanReach = False
for i in range(B,D):
    if S[i] == '#' and S[i+1] == '#':
        CanReach = False
if C < D:
    CanChange = True
for i in range(B-1,D-1):
    if S[i] == '.' and S[i+1] == '.' and S[i+2] == '.':
        CanChange = True
if CanReach and CanChange:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N,M = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(N)]
cd = [list(map(int,input().split())) for _ in range(M)]

for i in range(N):
  dist = float("inf")
  ans = 0
  a,b = ab[i][0],ab[i][1]
  
  for j in range(M)[::-1]:
    c,d = cd[j][0],cd[j][1]
    if abs(a-c) + abs(b-d) <= dist:
      dist = abs(a-c) + abs(b-d)
      ans = j + 1
  
  print(ans)
# Judge status: Accepted
X, Y = map(int, input().split())
def comb(n, r, mod=10 ** 9 + 7):
  n1 = n + 1
  r = min(n, n - r)
  numer = denom = 1
  for i in range(1, r + 1):
    numer = numer * (n1 - i) % mod
    denom = denom * i % mod
  return numer * pow(denom, mod - 2, mod) % mod
# x + y coordinates increase by 3 per one move
# x + y should be factor of 3
ans = 0
if (X + Y) % 3 == 0 and 2 * Y >= X and 2 * X >= Y:
  # The number of up move and right move
  up, right = (2 * Y - X) // 3, (2 * X - Y) // 3
  # up + right = (X + Y) % 3
  ans = comb(up + right, right)
print(ans)
# Judge status: Accepted
n,k,s=map(int,input().split());print(*[s]*k+[19]*(n-k))
# Judge status: Accepted
N = int(input())
X = list(map(int, input().split()))
ans = 10 ** 7

for i in range(1, 101):#1から100で開催
  ans1 = 0
  for j in range(N):
    ans1 += (X[j] - i) ** 2
  ans = min(ans, ans1)
  
print(ans)
# Judge status: Accepted
S,W = list(map(int,input().split()))

if S<=W:
    print("unsafe")
else:
    print("safe")
# Judge status: Accepted
import math
X = int(input())
curr = 100
yrs = 0
while curr < X:
    curr = math.floor(curr * 1.01)
    yrs += 1
print(yrs)
# Judge status: Accepted
a = int(input())
if a == 22:
  print('Christmas Eve Eve Eve')
elif a == 23:
  print('Christmas Eve Eve')
elif a == 24:
  print('Christmas Eve')
else:
  print('Christmas')
# Judge status: Accepted
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

if __name__ == '__main__':
    b, c = map(int, input().split())

    if b % 3 ==0 or c % 3 == 0 or (b+c) %3 ==0:
        print("Possible")
    else:
        print("Impossible")
# Judge status: Accepted
l = int(input())

print((l / 3)**3)
# Judge status: Accepted
k = int(input())

ans = list(range(1, 10))
next_ans = ans

while len(ans)<k:
  temp_ans = []
  
  for a in next_ans:
    a_0 = int(str(a)[-1])
    new_ans = [int(str(a)+str(a_0+i)) for i in [-1,0,1] if 0<=a_0+i<=9]
    temp_ans.extend(new_ans)
  
  ans.extend(temp_ans)
  next_ans = temp_ans
  
  
print(ans[k-1])
# Judge status: Wrong Answer
import collections
n = int(input())
s = [0]*n
c = {}
T = [0]*n
for i in range(n):
	s[i] = input()
	c[i] = collections.Counter(list(s[i]))
	T[i] = str(c[i])
D = collections.Counter(T)
ans = 0
for i in D.values():
	ans += i*(i-1)//2
print(ans)
# Judge status: Wrong Answer
from sys import stdin
import sys
import math

A, B, N = list(map(int, stdin.readline().rstrip().split()))

ans = []

#for x in range(N+1):
#    ans.append(math.floor(A * x / B) - A * math.floor(x / B))

#loop = min(B+1 ,N+1)
#for x in range(loop):
#    ans.append(math.floor(A * x / B) - A * math.floor(x / B))

max_ans = 0
for x in range(N+1)[::-1]:
    ans = math.floor(A * x / B) - A * math.floor(x / B)
    if ans < max_ans:
        print(max_ans)
        sys.exit()
    else:
        max_ans = ans
print(max_ans)
# Judge status: Wrong Answer
s=list(input())
t=list(input())
cnt=0
for i,e in zip(s,t):
  print(i,e)
  if i != e:
    cnt+=1
print(cnt)
# Judge status: Accepted
x = int(input())

for i in range(-1000,1000):
    for j in range(-1000,1000):
        if i ** 5 - j ** 5 == x:
            print(i,j)
            quit()
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n = int(input())
c = [0]*(n-1)
s = [0]*(n-1)
f = [0]*(n-1)

for i in range(n-1):
    c[i], s[i], f[i] = map(int, input().split())

from functools import lru_cache
@lru_cache(None)
def dfs(eki,t):
    if eki == n-1:
        return t

    cc = c[eki]
    ss = s[eki]
    ff = f[eki]

    return dfs(eki+1, max(ss, -(-t)//ff*ff)+cc)

for i in range(n):
    print(dfs(i,0))
# Judge status: Accepted
n=int(input())
ans=0
for i in range(n+1):
    if i%3==0 or i%5==0:
        i=0
    ans +=i
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
ans = 0
for i in range(n):
    g = 1 / n
    now = i+1
    while (True):
        if (now >= k):
            break
        now*=2
        g/=2
    ans += g
print(ans)
# Judge status: Accepted
n = int(input())
k = int(input())
x = int(input())
y = int(input())

o = n - k

sum = 0
if o > 0:
    sum += k * x
    sum += o * y
else:
    sum += n * x

print(sum)
# Judge status: Accepted
K = int(input())
if K % 2 == 0:
    print((K//2)**2)
else:
    print((K-1)//2 * ((K-1)//2 + 1))
# Judge status: Accepted
a, b, c = map(int, input().split())
k = int(input())

m = max([a, b, c])
s = a + b + c - m + m * 2 ** k
print(s)
# Judge status: Accepted
x = int(input())
a = x%100
n = x//100

if a <= 5*n:
    print("1")
else:
    print("0")
# Judge status: Accepted
n = int(input())

print((1999-n)//200+1)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
setA = set(A)
if len(setA) == N:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
from collections import Counter
n=int(input())
A=list(map(int,input().split()))
A=Counter(A)
S=[]
for i,j in A.items():
  if j>=2:
    S.append(i)

S.sort()

if len(S)>=2:
  print(S[-1]*S[-2])
else:
  print(0)
# Judge status: Wrong Answer
import math
a,b,t = map(int,input().split())
b*(t//a)
# Judge status: Accepted
a = int(input())
b = a**2
print(b)
# Judge status: Wrong Answer
a,b,t=map(int,input().split())
a=float(a)
t=float(t)
c=0
n=2.0
while True:
    if a<=t+0.5:
        c+=b
        k=a*n
        a=k
        n+=1.0
    else:
        break
print(c)
# Judge status: Accepted
#!/usr/bin/python3
# -*- coding:utf-8 -*-

import heapq

def main():
  MAX = 10**9
  n, m = map(int, input().strip().split())
  As = sorted(list(map(lambda x:-int(x), input().strip().split())))
  hq = heapq.heapify(As)
  for _ in range(m):
    x = heapq.heappop(As)
    x = -(-x//2)
    x = heapq.heappush(As, x)
  print(-sum(As))
    
if __name__=='__main__':
  main()
# Judge status: Accepted
a,b=map(int,input().split())
s=input()
if s[a]!="-":
  print("No")
else:
  cnt=0
  for i in range(a+b+1):
    if s[i]=="-":
      cnt+=1
  if cnt!=1:
    print("No")
  else:
    print("Yes")
# Judge status: Wrong Answer
s = list(open(0).read())
len_rev = len(s) // 2
cnt = 0
for i in range(len_rev):
  if s[i] != s[-i-1]:
    cnt += 1
print(cnt)
# Judge status: Accepted
import sys
N, C, K = map(int, input().split())
A = list(map(int, sys.stdin.readlines()))+[10**10]
A.sort()
a, c, t = 0, 1, A[0]+K
for i in A[1:]:
    if i <= t and c < C:
        c += 1
    else:
        t, c = i + K, 1
        a += 1
 
print(a)
# Judge status: Accepted
n,k=map(int,input().split())
cnt=0
p=10**9+7
for i in range(k,n+2):
  cnt+=1+(i*(2*n-i+1))//2-(i*(i-1))//2
  if cnt>=p:
    cnt%=p
print(cnt)
# Judge status: Accepted
n, *A = map(int, open(0).read().split())
x, y = A[0], sum(A[1:])

ans = abs(x-y)
for i in range(1, n-1):
  x += A[i]
  y -= A[i]
  ans = min(ans, abs(x-y))
print(ans)
# Judge status: Accepted
n = int(input())
d = list(map(int,input().split()))
d.sort()
if(d[n//2-1] == d[n//2]):
  print("0")
else:
  print(d[n//2] - d[n//2-1])
# Judge status: Accepted
S=str(input())
l=len(S)
key='keyence'
if S=='keyence':
  print('YES')
  exit()
else:  
  for i in range(1,l):
    for j in range(l):
      if S[0:j]+S[i+j:l]==key:
        print('YES')
        exit()
print('NO')
# Judge status: Wrong Answer
a,b,x = map(int,input().split())
print('No' if a>x else 'NO' if a+b<=x else 'Yes')
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    x=I()
    ans=(x//11)*2
    b=x%11
    if b<=6:
      ans+=1
    else:
        ans+=2
        
    print(ans)  
    

main()
# Judge status: Accepted
s = input()
ans = 10 ** 10
for i in range(len(s) - 2):
    num = int(s[i:i+3])
    ans = min(ans, abs(num - 753))
print(ans)
# Judge status: Wrong Answer
K, N = map(int, input().split())
A = list(map(int, input().split()))

tmp1 = A[-1] - A[0]
tmp2 = A[-1] - (20 - A[0] - A[-1])

print(min(tmp1, tmp2))
# print(A[-1]-A[0])
# Judge status: Accepted
N = int(input())
v_list = sorted(list(map(int,input().split())))
ans = (v_list[0]+v_list[1])/2
if N != 2:
    for i in range(2,N):
        ans = (ans + v_list[i])/2
print(ans)
# Judge status: Wrong Answer
h, n = map(int, input().split())
a = map(int, input().split())
if sum(a)>=h:
  print("Y")
else:
  print("N")
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
# 単純な話
money = 1000
stock = 0
for i in range(N-1):
    if A[i]<A[i+1]:
        stock += money//A[i]
        money %= A[i]
        money += stock*A[i+1]
        stock = 0
print(money)
# Judge status: Accepted
n,a,b=map(int,input().split())

ans=n//(a+b)*a
n%=(a+b)

if n<=a:
    ans+=n
else:
    ans+=a

print(ans)
# Judge status: Accepted
import sys
from collections import deque
from bisect import bisect_left

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    A = list(int(input()) for _ in range(n))

    que = deque([A[0]])
    for i in range(1, n):
        idx = bisect_left(que, A[i])
        if idx == 0:
            que.appendleft(A[i])
        else:
            idx -= 1
            que[idx] = A[i]
    print(len(que))


if __name__ == '__main__':
    resolve()