Harryxun/stf_run huggingface dataset:
n=int(input())
a=list(map(int,input().split()))
ct=0
list=[]

if n==1:print(0)
else:
  for g in range(50):
    list.append(2**g)
  
  M=max(a)
  
  if M>=10**6:
    while M>=10**6:
      for h in range(len(a)):
        if M<10**6:
          break
        elif M+a[h] in list:
          ct+=1
          a.remove(M)
          a.remove(a[h])
          break
        else:
          a.remove(M)
        M=max(a)
        
  
  
  
  for i in range(50):
    if 2**i>M:
      x=i
      break
  L=[]
  for j in range(2**x-1):
    L.append(0)
  
  for j2 in range(len(a)):
    L[a[j2]-1]+=1
  
  for k in range(x,1,-1):
    l1=L[0:2**(k-1)-1]
    l2=L[2**(k-1):2**k]
    l2.reverse()
    ct+=int(L[2**(k-1)-1]/2)
    for m in range(len(l1)):
      if l1[m]>=1 and l2[m]>=1:
        ct+=min(l1[m],l2[m])
        l1[m]-=min(l1[m],l2[m])
        l2[m]-=min(l1[m],l2[m])
    L=l1
  ct+=int(L[0]/2)
  print(ct)

### FIXED CODE ###

import math
import bisect
n=int(input())
a=list(map(int,input().split()))
a.sort()
b=[]
for i in range(1,50):
  b.append(2**i)
ct=0
check=[1]*n
for i in range(n-1,-1,-1):
  if a[i]==1:
    break
  if check[i]==1 and a[i] not in b:
    check[i]=0
    x=math.floor(math.log2(a[i]))
    x=b[x]-a[i]
    y=bisect.bisect_left(a,x)
    z=bisect.bisect_right(a,x)
    t=bisect.bisect_left(check[y:z],1)+y
    if t!=z:
      check[t]=0
      ct+=1

ctb=0
w=1
for i in range(n):
  if a[i] in b or a[i]==1:
    if a[i]==w:
      if check[i]==1:
        ctb+=1
    else:
      ct+=ctb//2
      w=a[i]
      if check[i]==1:
        ctb=1
      else:
        ctb=0
  else:
    ct+=ctb//2
    ctb=0
ct+=ctb//2

print(ct)
import math

#N行,距離D
N,D = map(int, input().split())

num_list = []
for i in range(N):
    num_list.append(list(map(int,input().split())))

count = 0
for p,q in num_list:
  d = math.sqrt(p**2 + q**2)
  if(d<=D):
    count += 1
    
print(count)

### FIXED CODE ###

N = int(input().strip())
if(N >= 30):
  print("Yes")
elif(N<30):
  print("No")
from math import sqrt
n = int(input())
s = int(input())

if n < s:
  print(-1)
  import sys
  sys.exit()

def f(b, n):
  if n < b:
    return n
  return f(b, n//b) + (n % b)

res = -1

for p in range(1, int(sqrt(n))+1):
  b = (n-s)//p + 1
  if f(b, n) == s:
    res = b
    break

for b in range(2, int(sqrt(n))+1):
  if f(b, n) == s:
    res = b
    break

print(res)

### FIXED CODE ###

from math import sqrt
n = int(input())
s = int(input())

if n < s:
  print(-1)
  import sys
  sys.exit()
if n == s:
  print(n+1)
  import sys
  sys.exit()

def f(b, n):
  if n < b:
    return n
  return f(b, n//b) + (n % b)

res = -1

for p in range(int(sqrt(n)), 0, -1):
  b = (n-s)//p + 1
  if b == 1:
    continue
  if f(b, n) == s:
    res = b
    break

for b in range(2, int(sqrt(n))+2):
  if f(b, n) == s:
    res = b
    break

print(res)
S=0
N = int(input())
l = map(int, input().split())

l = list(sorted(l))

for i in range(1, N+1):
    if i%2 == 1:
        S+=l[N-i]
        #print(S)
    else:
        S-=l[N-i]
        #print(S)
            

#print('--------')
print(S)

### FIXED CODE ###

N = int(input())
A = int(input())

n=N%500
if n<=A:
    print('Yes')
else:
    print('No')
x = int(input())
A = int(input())
B = int(input())

x = x-A
n = x//B
print(x-n+*B)

### FIXED CODE ###

x = int(input())
A = int(input())
B = int(input())

x = x-A
n = x//B
print(x-n*B)
from itertools import groupby, accumulate

N = int(input())
S = input()

l = [len(list(g)) for k, g in groupby(S)]
if S[0] == ".":
    l.pop(0)
if S[1] == "#":
    l.pop()

if len(l) == 0:
    print(0)
    exit()

min_num = 10**18

black = [0] + list(accumulate(l[::2]))
white = [0] + list(accumulate(l[1::2]))

x = len(l)//2
for i in range(x):
    m = black[i] + (white[x] - white[i])
    min_num = min(m, min_num)

print(min_num)


### FIXED CODE ###

from itertools import groupby, accumulate

N = int(input())
S = input()

l = [len(list(g)) for k, g in groupby(S)]
if S[0] == ".":
    l.pop(0)
if S[-1] == "#":
    l.pop()

if len(l) == 0:
    print(0)
    exit()

min_num = 10**18

black = [0] + list(accumulate(l[::2]))
white = [0] + list(accumulate(l[1::2]))

x = len(l)//2
for i in range(x+1):
    m = (black[i] - black[0]) + (white[x] - white[i])
    min_num = min(m, min_num)

print(min_num)
N = int(input())
list=[]
for i in range(N):
    list.append(int(input()))

a = []
i = 0
for i in range(N):
    a.append(int(0))
    while list[i] > 0 and list[i] % 2 == 0:
        a[i] = a[i] + 1
        list[i] = int(list[i]/2)
print(min(a))

### FIXED CODE ###

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

a = []
i = 0
for i in range(N):
    a.append(int(0))
    while list[i] % 2 == 0:
        a[i] = a[i] + 1
        list[i] = int(list[i]/2)
print(min(a))
x = int(input())
pint(x^1)

### FIXED CODE ###

x = int(input())
print(x^1)
N, M = map(int, input().split())
check = [1] * M
for i in range(N):
    a = [int(i) for i in input().split()]
    a = a[1:]
    for i in a:
        check[i] = 0

print(sum(check))

### FIXED CODE ###

N, M = map(int, input().split())
check = [0] * M
for i in range(N):
    a = [int(i) - 1 for i in input().split()]
    a = a[1:]
    for j in a:
        check[j] += 1


ans = 0
for i in check:
    if i == N:
        ans += 1
print(ans)
import math

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

def sol(a, b):
    return (a * b) // math.gcd(a, b)


a, b = list(map(int, input().split()))
print(sol(a, b))

### FIXED CODE ###

#-*- coding: utf-8 -*-


def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n
def lcm(x, y):
    return (x * y) // gcd(x, y)

def sol(a, b):
    return (a * b) // gcd(a, b)


a, b = list(map(int, input().split()))
print(sol(a, b))
import sys
x,y=map(int,input().split())
if (x+y)%3!=0:
    print(0)
    sys.exit()
dx=x-(x+y)//3
dy=y-(x+y)//3
fact=[1]*(dx+dy+1)
MOD=10**9+7
def inv_mod(a):
  return pow(a,MOD-2,MOD)

for i in range(1,dx+dy+1):
  fact[i] = (i*fact[i-1])%MOD
fact_inv = [1] * (dx+dy+1)
fact_inv[-1] = inv_mod(fact[-1])
for i in range(dx+dy,0,-1):
  fact_inv[i-1] = (i*fact_inv[i])%MOD

def comb(n,k):
  x = fact[n]
  x *= fact_inv[k]
  x %= MOD
  x *= fact_inv[n-k]
  x %= MOD
  return x
print(comb(dx+dy,dx))

### FIXED CODE ###

import sys
x,y=map(int,input().split())
if (x+y)%3!=0:
    print(0)
    sys.exit()
dx=x-(x+y)//3
dy=y-(x+y)//3
if dx<0 or dy<0:
    print(0)
    sys.exit()
fact=[1]*(dx+dy+1)
MOD=10**9+7
def inv_mod(a):
  return pow(a,MOD-2,MOD)

for i in range(1,dx+dy+1):
  fact[i] = (i*fact[i-1])%MOD
fact_inv = [1] * (dx+dy+1)
fact_inv[-1] = inv_mod(fact[-1])
for i in range(dx+dy,0,-1):
  fact_inv[i-1] = (i*fact_inv[i])%MOD

def comb(n,k):
  x = fact[n]
  x *= fact_inv[k]
  x %= MOD
  x *= fact_inv[n-k]
  x %= MOD
  return x
print(comb(dx+dy,dx))
n = int(input())

a = [0  for i in range(n)]
b = [0  for i in range(n)]
x = [[0,0,0]  for i in range(n+2)]

for i in range(n):
    a[i],b[i]=map(int,input().split())
    x[i][0]=abs(a[i]-b[i])
    x[i][1]=a[i]
    x[i][2]=b[i]

s=sorted(x,reverse=True)


nu=n//2
mod=n%2

count=0
for i in range(nu):
    count+=x[i*2][1]

    count-=x[i*2+1][2]


if mod==1:
    counta=x[2*nu][1]

    

    

print(counta)

### FIXED CODE ###

n = int(input())

a = [0  for i in range(n)]
b = [0  for i in range(n)]
x = [[0,0,0]  for i in range(n)]

for i in range(n):
    a[i],b[i]=map(int,input().split())
    x[i][0]=abs(a[i]+b[i])
    x[i][1]=a[i]
    x[i][2]=b[i]

s=sorted(x,reverse=True)
#print(s)

nu=n//2
mod=n%2

count=0
for i in range(nu):
    count+=s[i*2][1]
  #  print(count)
    count-=s[i*2+1][2]
 #   print(count)

if mod==1:
    count+=s[2*nu][1]

    

    

print(count)
n = int(input())
q = []
bottom = 0
for i in range(n):
    cmd = input()
    if cmd[0] == 'i':
        q.append(cmd[7:])
    elif cmd[6] == ' ':
        try:
            q.pop(~q[::-1].index(cmd[7:]))
        except:
            pass
    elif cmd[6] == 'F':
        q.pop()
    else:
        bottom += 1
 
print(' '.join(q[bottom:][::-1]))

### FIXED CODE ###

import sys
from collections import deque

n = int(sys.stdin.readline())
q = deque()
for i in range(n):
    cmd = sys.stdin.readline()[:-1]
    if cmd[0] == 'i':
        q.appendleft(cmd[7:])
    elif cmd[6] == ' ':
        try:
            q.remove(cmd[7:])
        except:
            pass
    elif cmd[6] == 'F':
        q.popleft()
    else:
        q.pop()

print(' '.join(q))
from collections import deque
n = int(input())
l = deque()
count = set([])
for _ in range (n):
    cmd = input().split(' ')
    print(cmd)
    if cmd[0]=='insert':
        l.appendleft(int(cmd[1]))
        if not int(cmd[1]) in count:
            count.add(int(cmd[1]))
    if cmd[0]=='delete':
        if len(l) !=0 and int(cmd[2]) in count:
            l.remove(int(cmd[1]))
    if cmd[0]=='deleteFirst':
        l.popleft()
    if cmd[0]=='deleteLast':
        l.pop()
    print(*l)


### FIXED CODE ###

from collections import deque
n = int(input())
l = deque()
for _ in range (n):
    cmd = input().split(' ')
    if cmd[0]=='insert':
        l.appendleft(cmd[1])  
    if cmd[0]=='delete':
        try:l.remove(cmd[1])
        except :pass
    if cmd[0]=='deleteFirst':
        l.popleft()
    if cmd[0]=='deleteLast':
        l.pop()
print(*l)
a,b=map(int,input().split())
i=1
while True:
  if (int(i*0.08)==a and i(i*0.1)==b):
    print(i)
    exit()
  if i>200:
    print(-1)
    exit()
  i=i+1

### FIXED CODE ###

a,b=map(int,input().split())
for i in range(2000):
  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    exit()
print(-1)
a,b,c = int(input().split())
a,b,c = c,a,b
print(a,b,c)

### FIXED CODE ###

a,b,c = map(int, input().split())
a,b,c = c,a,b
print(a,b,c)
import sympy
N=int(input())
ans=0
a=0
for i in range(1,N+1,2):
    for j in range(1,i+1):
        if i%j==0:
            a+=1
            if a==8:
                ans+=1

print(ans)

### FIXED CODE ###

N=int(input())
ans=0
for i in range(1,N+1,2):
    a=0
    for j in range(1,i+1):
        if i%j==0:
            a+=1
            if a==8:
                ans+=1

print(ans)
N, K = map(int, input().split())
A = list(map(int, input().split()))
MOD = 10**9 + 7

# case1. N == K のときは答えは確定
if N == K:
    ans = 1
    for i in range(K):
        ans *= A[i]
        ans %= MOD
    print(ans)
# case2. A が全部負の数のとき、 Kが奇数ならば残念ながら答えは負になるのでなるべく絶対値を小さくする
elif max(A) < 0 and K % 2 == 1:
    ans = 1
    A = sorted(A, reverse=True)
    for i in range(K):
        ans *= A[i]
        ans %= MOD
    print(ans)
else:
    # case3. それ以外は正にできるので、絶対値の降順にソートする
    A = sorted(A, key=lambda x: abs(x), reverse=True)
    # とりあえず大きい順に K 個掛けてみる
    ans = 1
    for i in range(K):
        ans *= A[i]
    if ans >= 0:
        ans %= MOD
        print(ans)
    else:
        # 取り除く対象を old, 取り込む対象を new とする
        # case3-1. 負数を取り除いて非負数を取り込む
        # まずは new を探す
        j = K
        while j < N and A[j] < 0:
            j += 1
        if j < N:
            new1 = A[j]
        # old を探す
        l = K-1
        while A[l] >= 0:
            l -= 1
        old1 = A[l]
        if new1 and old1:
            cand1 = ans // old1 * new1
        # case3-2. 非負数を取り除いて負数を取り込む
        # まずは new を探す
        j = K
        while j < N and A[j] >= 0:
            j += 1
        if j < N:
            new2 = A[j]
        # old を探す
        l = K-1
        while A[l] < 0:
            l -= 1
        old2 = A[l]
        if new2 and old2:
            cand2 = ans // old2 * new2

        if cand1 and cand2:
            ans = max(cand1, cand2) % MOD
        elif cand1:
            ans = cand1 % MOD
        else:
            ans = cand2 % MOD
        print(ans)


### FIXED CODE ###

from heapq import heappush, heappop


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

MOD = 10**9 + 7

# case1. N == K のときは答えは確定
if N == K:
    ans = 1
    for i in range(K):
        ans *= A[i]
        ans %= MOD
    print(ans)
# case2. A が全部負の数のとき、 Kが奇数ならば残念ながら答えは負になるのでなるべく絶対値を小さくする
elif max(A) < 0 and K % 2 == 1:
    ans = 1
    for i in range(K):
        ans *= A[i]
        ans %= MOD
    print(ans)
else:
    # case3. それ以外は正にできる

    # K が奇数のとき、非負要素から1つ取って偶数の場合に帰着
    # K が偶数のとき、面倒なので 2 つセットで考えて K//2 個取る問題に帰着

    if K%2 == 1:
        ans = A.pop(0)  # あらかじめ最大値を確保
        n = (K-1)//2
    else:
        ans = 1
        n = K//2

    # 絶対値の降順にソートする
    A = sorted(A, key=lambda x: abs(x), reverse=True)

    # 候補テーブルを作成
    cand = []  # 非負要素、負要素をそれぞれ絶対値の大きい順に 2 つずつ掛けたもの

    BIGINT = 10**9 + 1  # tmp 用
    tmp1 = BIGINT
    tmp2 = BIGINT

    for a in A:
        if a >= 0:
            if tmp1 == BIGINT:
                tmp1 = a
            else:
                heappush(cand, -tmp1*a)
                tmp1 = BIGINT
        else:
            if tmp2 == BIGINT:
                tmp2 = a
            else:
                heappush(cand, -tmp2*a)
                tmp2 = BIGINT

    # あとは大きい方から n 個取る
    for i in range(n):
        ans *= -heappop(cand)
        ans %= MOD
    print(ans)
#!/usr/bin/env python3
p

### FIXED CODE ###

#!/usr/bin/env python3
n = int(input())
d = list(map(int, input().split()))

d.sort()
h = n // 2 - 1

a = d[h]
b = d[h + 1]

print(b - a)
from math import *
from functools import *

n = int(input())
print(reduce(gcd, map(int, input().split())))


### FIXED CODE ###

from fractions import *
from functools import *

n = int(input())
print(reduce(gcd, map(int, input().split())))
X = int(input())

se = set(n**e)
for n in range(32):
    for e in range(2,11):
        if n**e <= X:
            exit()

answer = max(se)
print(answer)

### FIXED CODE ###

X = int(input())
se = set(n**e for n in range(32) for e in range(2,11) if n**e <= X)

answer = max(se)
print(answer)
import sys
from io import StringIO
import unittest

sys.setrecursionlimit(100**5)

def rec(n, a, seen):
	if seen[n-1]:
		return -1
	if a[n-1] == 2:
		return seen.count(True) + 1
	seen[n-1] = True
	return rec(a[n-1], a, seen)

def resolve():
	n = int(input())
	a = []
	seen = [False]*n
	for _ in range(n):
		a.append(int(input()))
	print(rec(1, a, seen))
resolve()

### FIXED CODE ###

import sys
from io import StringIO
import unittest

sys.setrecursionlimit(10**6)

def rec(n, a, seen):
	if seen[n-1]:
		return -1
	if a[n-1] == 2:
		return seen.count(True) + 1
	seen[n-1] = True
	return rec(a[n-1], a, seen)

def resolve():
	n = int(input())
	a = []
	seen = [False]*n
	for _ in range(n):
		a.append(int(input()))
	print(rec(1, a, seen))
resolve()
import sys
input = sys.stdin.readline
 
import numpy as np
 
def main():
  n, W = map(int, input().split())
  dp = np.zeros(W+1, dtype=np.int64)
  for _ in range(n):
    w, v = map(int, input().split())
    # 状態n,wにおいてwi,viを使うかどうかで更新する
    dp[w:W+1] = np.maximum(dp[:W-w+1]+v, dp[w:W+1])
  print(dp[W])

if __name__ == "__main__":
  main()


### FIXED CODE ###

# dp[n][w]とすると，O(nw)でwが大きすぎて大変
# dp[n][v]として，価値vを達成するための最小のwを記録するO(N^2 V_{max})
# さらにdp[v]としてw, vを使うかどうかで更新する
import sys
input = sys.stdin.readline
import numpy as np

n, W = map(int, input().split())
dp = np.full(10**5 + 1, 10**12, dtype='int64')
dp[0] = 0 
for _ in range(n):
    w, v = map(int, input().split())
    dp[v:] = np.minimum(dp[:-v]+w, dp[v:])

#print(np.max(np.where(dp <= W)))
print(np.where(dp <= W)[0][-1])
I,O,T,J,L,S,Z = map(int,input().split())
print(max(((I-1)//2+(J-1)//2+(L-1)//2)*2+O+3*(I>0*❨L>0❩*❨J>0❩,(I//2+J//2+L//2)*2+O))


### FIXED CODE ###

I,O,T,J,L,S,Z = map(int,input().split())
print(max(((I-1)//2+(J-1)//2+(L-1)//2)*2+O+3*(I>0)*(L>0)*(J>0),(I//2+J//2+L//2)*2+O))
from enum import Enum
from queue import Queue
import collections

import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
N = int(input())
H = list(map(int,input().split()))
cnt = 0
for i in range(N-1):
    if H[i] >= H[i+1]:
        cnt += 1
    else:
        if ans <= cnt:
            ans = cnt
        cnt = 0

if ans <= cnt:
    ans = cnt
print(ans)


### FIXED CODE ###

from enum import Enum
from queue import Queue
import collections

import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
N = int(input())
H = list(map(int,input().split()))
cnt = 0
ans = 0
for i in range(N-1):
    if H[i] >= H[i+1]:
        cnt += 1
    else:
        if ans <= cnt:
            ans = cnt
        cnt = 0

if ans <= cnt:
    ans = cnt
print(ans)
import math
a,b=print(input().split())
gcd=math.gcd(a,b)
print(a*b//gcd)

### FIXED CODE ###

import fractions
a,b=map(int,input().split())
gcd=fractions.gcd(a,b)
print(a*b//gcd)
def d170(n,a):
    sa=sorted(a)
    dp=[0 for i in range(max(a)+1)]
    if sa[0]==1:
        if sa[1]==1:
            return 0
        else:
            return 1
    else:
        for x in sa:
            if dp[x]==0:
                for j in range(x,n):
                    if j%x==0:
                            dp[j]+=1
        return dp.count(1)
    
n=int(input())
a=list(map(int, input().split()))    
print(d170(n,a))
            

### FIXED CODE ###

def d170(n,a):
    k=max(a)+1
    count=0
    dp=[0 for i in range(k)]
    for x in a:
        if dp[x]!=0:
                dp[x]=2
                
        else:
            for j in range(x,k,x):
                     dp[j]+=1
    for x in a:
        if dp[x]==1:
            count+=1
    return count
    
n=int(input())
a=list(map(int, input().split()))    
print(d170(n,a))
N=int(input())
S=input()
S="E"+S+"W"
E=[0]*(N+2)
W=[0]*(N+2)
for i in range(len(S)-1):
    if S[i]=="W":
        E[i+1]=E[i]+1
    else:
        E[i+1]=E[i]
 
for i in range(len(S)-1,0,-1):
    if S[i]=="E":
         W[i-1]=W[i]+1
    else:
         W[i-1]=W[i]
ans=10**9
for i in range(N):
    ans=min(ans,E[i+1]+W[i+1])
print(ans)
N=int(input())
S=input()
S="E"+S+"W"
E=[0]*(N+2)
W=[0]*(N+2)
for i in range(len(S)-1):
    if S[i]=="W":
        E[i+1]=E[i]+1
    else:
        E[i+1]=E[i]

for i in range(len(S)-1,0,-1):
    if S[i]=="E":
         W[i-1]=W[i]+1
    else:
         W[i-1]=W[i]
ans=10**9
for i in range(N):
    ans=min(ans,E[i+1]+W[i+1])
print(ans)


### FIXED CODE ###

N=int(input())
S=input()
S="E"+S+"W"
E=[0]*(N+2)
W=[0]*(N+2)
for i in range(len(S)-1):
    if S[i]=="W":
        E[i+1]=E[i]+1
    else:
        E[i+1]=E[i]

for i in range(len(S)-1,0,-1):
    if S[i]=="E":
         W[i-1]=W[i]+1
    else:
         W[i-1]=W[i]
ans=10**9
for i in range(N):
    ans=min(ans,E[i+1]+W[i+1])
print(ans)
from math import ceil
import bisect

N, D, A = map(int, input().split())
Monsters = sorted([list(map(int, input().split())) for i in range(N)])
X = [x for x, h in Monsters]
H = [ceil(h / A) for x, h in Monsters]

min_n = 0

for i in range(N):
  if H[i] <= 0:
    continue
  i_2Di = bisect.bisect_left(X, X[i]+2*D)
  H[i:i_2Di] -= A * ni
  min_n += ni
  
print(min_n)

### FIXED CODE ###

from math import ceil
from collections import deque
N, D, A = map(int, input().split())
Monsters = sorted([list(map(int, input().split())) for i in range(N)])
Monsters = [[x, ceil(h / A)] for x, h in Monsters]


acc_damage = 0
que = deque([])

ans = 0
for x, h in Monsters:
    # 期限切れの蓄積ダメージを削除
    while que and x > que[0][0]:
        limit, damage = que.popleft()
        acc_damage -= damage

    need = max(0, h - acc_damage)
    ans += need
    acc_damage += need

    if need:
        que.append([x + 2 * D, need])

print(ans)
n = int(input())
a = set(map(int, input().split()))

xs = [0] * (2 * (10 ** 5) + 1)
for v in a:
    if xs[v] == 0:
        for j in range(v, len(xs), v):
            xs[j] += 1
    else:
        xs[v] += 1
print(len(list(filter(lambda v: xs[v] == 1, a))))


### FIXED CODE ###

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

xs = [0] * (max(a) + 1)

for v in a:
    if xs[v] == 0:
        for j in range(v, len(xs), v):
            xs[j] += 1
    else:
        xs[v] += 1
print(len(list(filter(lambda v: xs[v] == 1, a))))
X,t = map(int,input().split())
ans = X-t
if ans>=0
    print(ans)
else:
    print(0)

### FIXED CODE ###

X,t = map(int,input().split())
ans = X-t
if ans>=0:
    print(ans)
else:
    print(0)
from colloctions import Counter
import numpy as np

def sum_of_gcd(N):
  temp = [np.gcd(i, k) for i in range(1, N+1) for k in range(1, N+1)]
  counts = Counter(temp)
  return sum([np.gcd(i, c)*counts[c] for i in range(1, N+1) for c in counts.keys()])

print(sum_of_gcd(int(input())))

### FIXED CODE ###

from scipy import gcd
from collections import Counter

def sum_of_gcd(N):
    temp = [gcd(i, k) for i in range(1, N+1) for k in range(1, N+1)]
    counts = Counter(temp)

    return sum([gcd(c, i)*counts[c] for i in range(1, N+1) for c in counts.keys()])

print(sum_of_gcd(int(input())))
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
x=[a,b,c,d,e]

l10=[int(i) for i in x if i % 10==0]
res=[]
for n in x:
    if n not in l10:
        res.append(n)

if not len(l10)==5:
    min_d=9
    for i in res:
        if int(str(i)[-1])<min_d:
            min_d=int(str(i)[-1])
            min_num=i
    
    re2=[]
    for m in res:
        if m != min_num:
            re2.append(m)
    
    s=0
    for si in re2:
        if len(str(si))==2:
            s+=int(str(si)[0])*10+10
        elif len(str(si))==1:
            s+=10
        else:
            s+=int(str(si)[:-1])*10+10 
    print(sum(l10)+min_num+s)
else:
    print(sum(l10))
    
    

    


### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

x=[a,b,c,d,e]

l10=[int(i) for i in x if i % 10==0]
res=x
for n in l10:
    res.remove(n)

if not len(l10)==5:
    min_d=9
    for i in res:
        if int(str(i)[-1])<=min_d:
            min_d=int(str(i)[-1])
            min_num=i
    
    re2=res
    
    re2.remove(min_num)
    
    s=0
    for si in re2:
        if len(str(si))==2:
            s+=int(str(si)[0])*10+10
        elif len(str(si))==1:
            s+=10
        else:
            s+=int(str(si)[:-1])*10+10 
    print(sum(l10)+min_num+s)
else:
    print(sum(l10))
import math
N, M = map(int, input().split())

if N-M == 0:
    n = 2*math.factorial(N)*math.factorial(M)
    n %= int(7+1e9)
    print(n)
elif abs(N-Mi) == 1:
    n = math.factorial(N)*math.factorial(M)
    n %= int(7+1e9)
    print(n)
else:
    print(0)

### FIXED CODE ###

import math
N, M = map(int, input().split())
if N-M == 0:
    n = 2*math.factorial(N)*math.factorial(M)
    n %= int(7+1e9)
    print(n)
elif abs(N-M) == 1:
    n = math.factorial(N)*math.factorial(M)
    n %= int(7+1e9)
    print(n)
else:
    print(0)
N = int(input())
a = []*N
for _ in range(N):
	a.append(list(map(int,input().split())))

dp = [[0,0]]*(N+1)
m = max(a[0])
j = a[0].index(m)
dp[0][0] = m
dp[0][1] = j
for i in range(N):
	prev = dp[i-1][1]
	m = 0
	for j in range(3):
		if j!=prev:
			m = max(a[i],m)
	j = a[i].index(m)
	dp[i][0] = dp[i-1][0] + m
	dp[i][1] = j
print(dp[N-1][0]) 


### FIXED CODE ###

N = int(input())
arr = []*N
for _ in range(N):
	arr.append(list(map(int,input().split())))

dp = [0,0,0]
for a in arr:
	dp = [a[0]+max(dp[1],dp[2]),a[1]+max(dp[0],dp[2]),a[2]+max(dp[0],dp[1])]

print(max(dp))
N=int(input())

M=[[0]*10 for _ in range(10)]
for i in range(1,N+1):
  S=str(i)
  f=int(S[0])
  b=int(S[-1])
  M[f][s]+=1
  
ans=0
for i in range(10):
  for j in range(10):
    ans+=M[i][j]*M[j][i]
    
print(ans)


### FIXED CODE ###

N=int(input())

M=[[0]*10 for _ in range(10)]
for i in range(1,N+1):
  S=str(i)
  f=int(S[0])
  b=int(S[-1])
  M[f][b]+=1
  
ans=0
for i in range(10):
  for j in range(10):
    ans+=M[i][j]*M[j][i]
    
print(ans)
def Gauss_sum(n):
  return n*(n+1)//2
a,b=map(int,input())
for i in range(999):
  if Gauss_sum(i+1)-a == Gauss_sum(i+2)-b:
    print(Gauss_sum(i+1)-a)
    break

### FIXED CODE ###

def Gauss_sum(n):
  return n*(n+1)//2
a,b=map(int,input().split())
for i in range(999):
  if Gauss_sum(i+1)-a == Gauss_sum(i+2)-b:
    print(Gauss_sum(i+1)-a)
    break