Harryxun/stf_run huggingface dataset:
n,x,y=map(int,input().split())
c=[0]*~-n
for i in range(n):
 for j in range(i):c[min(~j+i,abs(~j+x)+abs(~i+y))]+=1
print(*l)

### FIXED CODE ###

from collections import*
n,x,y=map(int,input().split())
e=[[]for _ in range(n)]
for i in range(n-1):
    e[i]+=i+1,
    e[i+1]+=i,
e[x-1]+=y-1,
e[y-1]+=x-1,
a=[0]*n
for s in range(n):
    d=[-1]*n
    d[s]=0
    q=deque([s])
    while q:
        v=q.popleft()
        for w in e[v]:
            if d[w]<0:
                d[w]=d[v]+1
                q+=w,
    for i in d:a[i]+=1
print(*[i//2for i in a[1:]])
#!/usr/bin/env python
# coding: utf-8

# In[38]:


import collections


# In[43]:


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


# In[49]:


a_cnt = collections.Counter(A)
p = sorted([i for i in a_cnt.items() if i[1] >= 2], reverse=True)
if p[0][1]>=4:
    print(p[0][0]**2)
elif len(p) > 1:
    print(p[0][0]*p[1][0])
else:
    print(0)


# In[ ]:






### FIXED CODE ###

#!/usr/bin/env python
# coding: utf-8

# In[38]:


import collections


# In[52]:


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


# In[54]:


a_cnt = collections.Counter(A)
p = sorted([i for i in a_cnt.items() if i[1] >= 2], reverse=True)
if len(p) > 0:
    if p[0][1]>=4:
        print(p[0][0]**2)
    elif len(p) > 1:
        print(p[0][0]*p[1][0])
    else:
        print(0)
else:
    print(0)


# In[ ]:
def segfunc(x, y): return max(x, y)

class SegmentTree:
    def __init__(self, arr):
        size = len(arr)
        n = 2 ** (size - 1).bit_length()
        self.n = n
        self.node = [0] * (2*n)
        for i in range(size):
            self.node[i+n-1] = arr[i]
        for i in reversed(range(n-2)):
            self.node[i] = segfunc(self.node[2*i+1], self.node[2*i+2])

    def update(self, i, x):
        i += self.n - 1
        self.node[i] = x
        while i > 0:
            i = (i - 1) // 2
            self.node[i] = segfunc(self.node[i * 2 + 1], self.node[i * 2 + 2])

    def update(self, x, val):
        x += (self.n - 1)
        self.node[x] = val
        while x > 0:
            x = (x - 1) // 2
            self.node[x] = segfunc(self.node[2 * x + 1], self.node[2 * x + 2])

    def query(self, a, b):
        res = 0
        l = self.n - 1 + a
        r = self.n - 1 + (b - 1)

        while l <= r:
            if l == r:
                res = segfunc(res, self.node[l])
                break

            if l % 2 == 0:
                res = segfunc(res, self.node[l])
            if r % 2 == 1:
                res = segfunc(res, self.node[r])
            l = l // 2
            r = r // 2 - 1

        return res

N, K = map(int, input().split())
INF = 0
seg = SegmentTree([0] * N)
for i in range(N):
    a = int(input())
    tmp = seg.query(max(a - K, 0), min(a + K, N) + 1) + 1
    seg.update(a, tmp)
print(seg.query(0, N))


### FIXED CODE ###

def segfunc(x, y): return max(x, y)

class SegmentTree:
    def __init__(self, arr):
        size = len(arr)
        n = 2 ** (size - 1).bit_length()
        self.n = n
        self.node = [0] * (2*n)
        for i in range(size):
            self.node[i+n-1] = arr[i]
        for i in reversed(range(n-2)):
            self.node[i] = segfunc(self.node[2*i+1], self.node[2*i+2])

    def update(self, i, x):
        i += self.n - 1
        self.node[i] = x
        while i > 0:
            i = (i - 1) // 2
            self.node[i] = segfunc(self.node[i * 2 + 1], self.node[i * 2 + 2])

    def update(self, x, val):
        x += (self.n - 1)
        self.node[x] = val
        while x > 0:
            x = (x - 1) // 2
            self.node[x] = segfunc(self.node[2 * x + 1], self.node[2 * x + 2])

    def query(self, a, b):
        res = 0
        l = self.n - 1 + a
        r = self.n - 1 + (b - 1)

        while l <= r:
            if l == r:
                res = segfunc(res, self.node[l])
                break

            if l % 2 == 0:
                res = segfunc(res, self.node[l])
            if r % 2 == 1:
                res = segfunc(res, self.node[r])
            l = l // 2
            r = r // 2 - 1

        return res

N, K = map(int, input().split())
INF = 0
seg = SegmentTree([0] * 300005)
for i in range(N):
    a = int(input())
    tmp = seg.query(max(a - K, 0), min(a + K, 300000) + 1) + 1
    seg.update(a, tmp)
print(seg.query(0, 300005))
s = input()
ans = 0
for x in s:
  ans += int(x)
if x%9 == 0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

s = input()
ans = 0
for x in s:
	ans += int(x)

if ans%9 == 0:
	print("Yes")
else:
	print("No")
a=eval(input().replace(' ', '+');print(a%2*'IMPOSSIBLE' or a//2)

### FIXED CODE ###

A, B = map(int, input().split())

if (A+B) % 2:
  print('IMPOSSIBLE')
else:
  print((A+B)//2)
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5]

for i in range(5)
    for j in range(5)
        if max <= price[5] - price[i]:
            print max

### FIXED CODE ###

import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans
N,A,B=map(int(),input().split())
K=A*int(N/(A+B))
amari=N%(A+B)
i=1
while ((amari-i)>0):
  i=i+1
K=K+i
print(K)

### FIXED CODE ###

N,A,B=map(int,input().split())
K=A*int(N/(A+B))
amari=N%(A+B)
if (amari>=A):
  i=A
elif (amari<A):
  i=amari
K=K+i
print(K)
x = input()
print (x**3)

### FIXED CODE ###

x = input()
print x ** 3
input = sys.stdin.readline
N = input()
tmp = N[0]
count = 0
for n in N:
    if tmp == n:
        count += 1
        if count == 3:
            break
    else:
        count = 0
        tmp = n
if count == 3:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import sys
input = sys.stdin.readline
N = list(map(int, list(input().strip())))
if sum(N[:3])%3 == 0 or sum(N[1:])%3 == 0:
    if sum(N[:3])//3 == N[0] or sum(N[1:])//3 == N[-1]:
        print("Yes")
    else:
        print("No")
else:
    print("No")
import itertools
N=int(input())
A=list(map(int, input().split()))
ans=0
for any_pair in itertools.combinations(A, 3):
    pair=sorted(any_pair)#新しいリストを作成
    print(type(pair))
    if pair[0]+pair[1]>pair[2] and pair[0]!=pair[1] and pair[1]!=pair[2]:
        ans+=1
        print(pair)
print(ans)

### FIXED CODE ###

X,K,D=map(int, input().split())
n=(K*D-X)//(2*D)
#print(n)
if n<0:
    ans=abs(X-K*D)
elif n>=K:
    ans=abs(X+K*D)
else:
    ans1=abs(X+(2*n-K)*D)
    ans2=abs(X+(2*(n+1)-K)*D)
    ans=min(ans1,ans2)
    #print(n,ans1,ans2)
print(ans)
n = int(input())
a = [int(input()) for _ in range(n)]
def search(i, p):
    if p > n:
        print(-1)
        exit()
    elif i == 2:
        print(p)
        exit()
    else:
        search(a[i-1], p+1)

search(1, 0)


### FIXED CODE ###

import sys
sys.setrecursionlimit(500*500)
n = int(input())
a = [int(input()) for _ in range(n)]
def search(i, p):
    if p > n:
        print(-1)
        exit()
    elif i == 2:
        print(p)
        exit()
    else:
        search(a[i-1], p+1)

search(1, 0)
n=int(input())
a=list(map(int,input().split()))
d={}
def k(a):
      return ','.join(map(str,a))
def dp(a):
      ka=k(a)
      if ka in d:
            return [d[ka][0],d[ka][1]]
      if len(a)==1:
            d[ka]=[a[0],[]]
            return a[0],[]
      elif len(a)==2:
            d[ka]=[max(a),[min(a)]]
            return max(a),[min(a)]
      else:
            if a[0]-dp(a[1:])[0]>a[-1]-dp(a[:-1])[0]:
                  d[ka]=[a[0],a[1:]]
                  return a[0],a[1:]
            else:
                  d[ka]=[a[-1],a[:-1]]
                  return a[-1],a[:-1]
x,y=0,0
while a!=[]:
      x_,a=dp(a)
      x+=x_
      if a==[]:
            break
      y_,a=dp(a)
      y+=y_
print(x-y)


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
dp=[[0]*n for _ in range(n)]
# dp[i][j]:i<=j,i番目からj番目までの数列(j-i+1個)を前にした時、ゲーム終了までに自分が取れる最大得点。i,j=0,..,n-1
sa=[0]
s=0
for ai in a:
      s+=ai
      sa.append(s)
for len in range(1,n+1):
      for l in range(n-len+1):
            r=l+len-1
            s=sa[r+1]-sa[l]
            dp[l][r]=max(s-dp[l][r-1],s-dp[l+1][r] if l+1<n else 0)
print(2*dp[0][-1]-sa[-1])
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a, b = MAP()
if a != b:
    print("D")
else:
    print("H")


### FIXED CODE ###

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a, b = S_MAP()
if a != b:
    print("D")
else:
    print("H")
H=input()
A=input()
n=H//A+1
print(n)

### FIXED CODE ###

H,A =input().split()
h = int(H)
a = int(A)
if h % a == 0:
    n = h // a
else:
    n = h // a +1
print(n)
import sys

l = [True] * 100000
for i in range(2, 100000):
    if (l[i - 1]):
        for j in range(i ** 2 - 1, 100000, i):
            l[j] = False
n = [int(line) for line in sys.stdin]
for nn in n:
    print(l[1:int(n)].count(True))

### FIXED CODE ###

import sys

l = [True] * 1000000
for i in range(2, 1000000):
    if (l[i - 1]):
        for j in range(i ** 2 - 1, 1000000, i):
            l[j] = False

for s in sys.stdin:
    print(l[1:int(s)].count(True))
th,ts,ah,as = map(int,input().split())
while Ture:
  ah -= ts
  if ah <= 0:
    print('Yes')
    break
  else:
    th -= as
    if th <= 0:
      print('No')
      break

### FIXED CODE ###

TH,TS,AH,AS = map(int,input().split())
while True:
  AH -= TS
  if AH <= 0:
    print('Yes')
    break
  else:
    TH -= AS
    if TH <= 0:
      print('No')
      break
import numpy as np
h,n=map(int,input().split())
ab=np.array([list(map(int,input().split())) for _ in range(n)])
dp=np.zeros(h+1,np.int64) #dp[i]:残り体力がiのとき、倒すまでの最小魔力
dp[0]=0
for a,b in ab:
      dp[1:a+1]=np.minimum(dp[1:a+1],b)
# a:減らせる体力
# b:魔力
for i in range(1,h+1):
  dp[i]=np.min(dp[i-ab[:,0]]+ab[:,1])
print(dp[-1])


### FIXED CODE ###

import numpy as np
h,n=map(int,input().split())
ab=np.array([list(map(int,input().split())) for _ in range(n)])
dp=np.zeros(10**4+1,np.int64) #dp[i]:残り体力がiのとき、倒すまでの最小魔力
dp[0]=0
for a,b in ab:
      dp[1:a+1]=np.minimum(dp[1:a+1],b)
# a:減らせる体力
# b:魔力
for i in range(1,h+1):
  dp[i]=np.min(dp[i-ab[:,0]]+ab[:,1])
print(dp[h])
n = list(map(input().split()))
n.sort()
print(int(n[2])-int(n[0]))

### FIXED CODE ###

n = list(map(int,input().split()))
n.sort()
print(n[2]-n[0])
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())
 
n = ni()
xyh = []
for _ in range(n):
    xyh.append(tuple(list(li())))
    
 
# 中心になりうる点を全探索
def search_cent(xyh: list):
    n = len(xyh)
    for x_cent in range(101):
        for y_cent in range(101):
            
            # 各点と中心との距離
            dist = []
            is_cent = True
            for x,y,_ in xyh:
                dist.append((abs(x-x_cent), abs(y-y_cent)))
                
            # 中心との距離と高さの差に矛盾が無いかチェック
            for i in range(n):
                for j in range(n):
                    if xyh[i][2] - sum(dist[i]) < 0 or xyh[j][2] - sum(dist[j]) < 0:
                        pass
                    
                    if (xyh[i][2]-xyh[j][2]) != -(sum(dist[i]) - sum(dist[j])):
                        is_cent = False
                        break
                if not is_cent:
                    break
 
            if is_cent:
                return x_cent, y_cent
 
                
x_cent, y_cent = search_cent(xyh)
h_cent = xyh[0][2] + abs(xyh[0][0] - x_cent) + abs(xyh[0][1] - y_cent)
 
print(x_cent, y_cent, h_cent)

### FIXED CODE ###

import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())
 
n = ni()
xyh = []
for _ in range(n):
    xyh.append(tuple(list(li())))

def search_cent(xyh:list):    
    xmax ,ymax, hmax = -1, -1, -1
    for x,y,h in xyh:
        if h > hmax:
            xmax = x
            ymax = y
            hmax = h
            
    for x_cent in range(101):
        for y_cent in range(101):
            h_cent = hmax + abs(xmax-x_cent) + abs(ymax-y_cent)
            
            # 矛盾チェック
            is_cent = True
            for x,y,h in xyh:
                hi = max(0, h_cent - abs(x-x_cent) - abs(y-y_cent))
                
                if hi != h:
                    is_cent = False
                    break

            if is_cent:
                return x_cent, y_cent, h_cent
        
xc, yc, hc = search_cent(xyh)
print(xc,yc,hc)
import math
def main():
    N,D,A = map(int, input().split())
    X,H = [0]*N,[0]*N
    for i in range(N):
        x,H[i] = map(int, input().split())
        X[i] =  x-1
    # 座標X[i]のモンスターはceil(H[i]/A)回攻撃すれば倒せる
    # N=4, D=2
    # 0 1 2 3 4 5 6 7 8 9 10
    # 0 5 0 2 0 0 3 3 0 0 4 (倒すのに必要な回数; 全部0にすれば終了)
    # 0 0 0 0 0 0 3 3 0 0 4 (座標1~3のどこかで5回爆破したあと)
    # 0 0 0 0 0 0 0 0 0 0 0 (座標8で4回爆破したあと)
    # ->よって5+4=9回が最小回数..?
    health = [0]*(max(X)+1)
    for i in range(N):
        health[X[i]] = math.ceil(H[i]/A)
    ans = 0
    for left in X:
        if health[left]>0:
            # left+Dで爆破を行う
            ans += health[left]
            health[left:left+2*D+1] = [max(0,p-health[left]) for p in health[left:left+2*D+1]]
    print(ans)

main()


### FIXED CODE ###

from math import ceil
from collections import deque
def main():
    N,D,A = map(int, input().split())
    # 座標X[i]のモンスターはceil(H[i]/A)回攻撃すれば倒せる
    # N=5, D=2
    # 0 1 2 3 4 5 6 7 8 9 10
    # 0 5 0 2 0 0 3 3 0 0 4 (倒すのに必要な回数; 全部0にすれば終了)
    # 0 0 0 0 0 0 3 3 0 0 4 (座標3で5回爆破したあと)
    # 0 0 0 0 0 0 0 0 0 0 1 (座標8で3回爆破したあと)
    # 0 0 0 0 0 0 0 0 0 0 0 (座標10で1回爆破したあと)
    # ->よって5+3+1=9回が最小回数..?

    Monsters = sorted([list(map(int, input().split())) for i in range(N)])
    Monsters = [[x-1, 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)


main()
n = int(input())
lis = []

for a in range(1, int(n**0.5)):
  if n % a == 0:
    lis.append(max(a, int(n/a)))

print(len(str(min(lis))))

### FIXED CODE ###

n = int(input())
lis = []

for a in range(1, int(n**0.5)+1):
  if n % a == 0:
    lis.append(max(a, int(n/a)))

print(len(str(min(lis))))
S = input()
print("Yes" if S[2] == S[3] and S[4] == S[5])

### FIXED CODE ###

S = input()
print("Yes" if S[2] == S[3] and S[4] == S[5] else "No")
def gcd(A, B):
    while B != 0:
        A, B = B, A%B
    return A

N, M = map(int, input().split())
S = input()
T = input()
agc = N * M // gcd(N, M)
can = True
i = 0
while i*L_M < agc and i*L_N < agc:
    if S[i*L_M] != T[i*L_N]:
        can = False
        break
    i += 1
    if can:
    print(agc)
else:
    print(-1)

### FIXED CODE ###

def gcb(A, B):
    while B != 0:
        A, B = B, A%B
    return A

N, M = map(int, input().split())
S = input()
T = input()
can = True
agc = N // gcb(N, M) * M
L_N = agc // N
L_M = agc // M
i = 0
while i*L_M < N and i*L_N < M:
    if S[i*L_M] != T[i*L_N]:
        can = False
        break
    i += 1

if can:
    print(agc)
else:
    print(-1)
x = (int())
print(x**3)\n

### FIXED CODE ###

x = int(input())
print (x ** 3)
def main():
    s = input().rstrip()
    k = int(input().rstrip())

    if s[0] != '1':
        print(s[0])
        return

    cnt = 0
    for a in s:
        if a == '1':
            cnt += 1

    if k < cnt:
        print(1)
    else:
        print(s[cnt])
    
    
main()


### FIXED CODE ###

def main():
    s = input().rstrip()
    k = int(input().rstrip())

    if s[0] != '1':
        print(s[0])
        return

    cnt = 0
    for a in s:
        if a == '1':
            cnt += 1
        else:
            break

    if k <= cnt:
        print(1)
    else:
        print(s[cnt])
    
    
main()
n,k,s = map(int,input().split())
if s == 10 ** 9:
    num = 10 ** 9-1
else:
    num == 10 ** 9
print(" ".join([str(s)]+["0" for i in range(k-1)]+[str(num) for j in range(n-k)]))

### FIXED CODE ###

n,k,s = map(int,input().split())
ans = []
if s == 10 ** 9:
    num = 10 ** 9-1
else:
    num = 10 ** 9
for i in range(k):
    ans.append(str(s))
for i in range(n-k):
    ans.append(str(num))
print(" ".join(ans))
alphabet = "abcdefghijklmnopqrstuvwxyz"
indmap = {}
for i, c in enumerate(alphabet):
    indmap[c] = i

MOD = 10L**9L + 7L

def main():
    n = int(input())
    s = input()

    counts = [0L]*26
    for c in s:
        counts[indmap[c]] += 1L

    #print(counts)
    total = 1L
    for k in counts:
        total *= (k+1L)
        total % MOD
    print(total-1)

main()


### FIXED CODE ###


alphabet = "abcdefghijklmnopqrstuvwxyz"
indmap = {}
for i, c in enumerate(alphabet):
    indmap[c] = i

MOD = 10**9 + 7

def main():
    n = int(input())
    s = input()

    counts = [0]*26
    for c in s:
        counts[indmap[c]] += 1

    #print(counts)
    total = 1
    for k in counts:
        total *= (k+1)

    print((total-1) % MOD)

if __name__ == "__main__":
    main()
rom collections import deque
n = int(input())
nd = deque(map(int, input().split()))
c = 0
for i in range(n):
    m = min(nd)
    s = nd.popleft()
    if (s != m):
        for k in nd:
            if (k < s):
                c += 1
    
print(c)


### FIXED CODE ###

n = int(input())
nlist = list(map(int, input().split()))
W = [0for i in range(n)]
def M(l,r):      ##l~r-1 까지의 리스트.
    if (l+1 >= r):
        return 0
    elif (l+2 == r):
        if (nlist[l] <= nlist[l+1]):
            return 0
        else:
            nlist[l],nlist[l+1] = nlist[l+1],nlist[l]
            return 1
    ##위의 if문으로 (r-l)가 2이하일 경우는 해놓음
    m = (l+r)//2
    i = l
    j = m
    k = l
    cl = M(l,m)
    cr = M(m,r)
    c = 0
    while (i<m and j<r):
        if (nlist[i] <= nlist[j]):
            W[k] = nlist[i] ##l부터 r까지 W에 크기순으로 대입해나감
            k += 1
            i += 1
        else:
            W[k] = nlist[j]  ##일단 W[k]에는 더 작은쪽을 저장하는듯
            k += 1
            j += 1
            c += (m-i)  ##만약 nlist[i] > nlist[j]라면 i~m-1 까지 반전 하고있기 때문
                        ##그러고 더 작은 nlist[j]를 안에 넣는것.
    while (i<m):   ##i번째쪽에 더 큰것들이 남았을 경우 (j=r 이 되있는 상황이기에 더 반전수를 늘리지는 않음)
        W[k] = nlist[i]
        k += 1
        i += 1
    while (j<r):   ##j쪽에 큰게 남아있는경우도 동일
        W[k] = nlist[j]
        k += 1
        j += 1
    for i in range(l,r): 
        nlist[i] = W[i]
    return cl+cr+c
        
print(M(0,n))
N = int(input())
a = [int(x) for x in input().split()]

summary = {}
for x in a:
    if x not in summary.keys():
        summary[x] = 1
    else:
        summary[x] += 1

res = 0
for k, v in summary.items():
    if k > v:
        res += v
    else:
        res += min(v - k, v)

print(res)

### FIXED CODE ###

N = int(input())
a = [int(x) for x in input().split()]

summary = {}
for x in a:
    if x not in summary.keys():
        summary[x] = 1
    else:
        summary[x] += 1

res = 0
for k, v in summary.items():
    if k > v:
        res += v
    else:
        res += min(v - k, v)

print(res)
N, X =map(int, input().split())
L = list(map(int, input().split()))
tmp=0
cnt=0

for i in range(N+1):
	if tmp <= X:
		cnt+=1
	else:
		break
	tmp+=L[i]
		
print(cnt)

### FIXED CODE ###

N, X =map(int, input().split())
L = list(map(int, input().split()))
tmp=0
cnt=0

for i in range(N+1):
	if tmp <= X:
		cnt+=1
	else:
		break
	if i < N:
		tmp+=L[i]
		
print(cnt)
n,k = map(int,input())
a = [int(input()) for i in range(n)]
a.sort()
ans = []
for i in range(n-k+1):
 ans.append(a[i+k-1] - a[i])
print(min(ans))
 


### FIXED CODE ###

n,k = map(int,input().split())
a = [int(input()) for i in range(n)]
a.sort()
ans = []
for i in range(n-k+1):
 ans.append(a[i+k-1] - a[i])
print(min(ans))
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
list=[a,b,c,d,e]
list2=[a%10,b%10,c%10,d%10,e%10]
worst=10
worstnum=0
flag=0
count=0
for i in range(5):
  if list2[i] != 0:
    if list2[i] < worst:
      worst = list2[i]
      flag = i
      worstnum=list[i]
  list[i] += 10-list[i]%10
for i in range(5):
  if i = flag:
    count += worstnum
  else:
    count += list[i]
print(count)

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
list=[a,b,c,d,e]
worst=10
flag=0
ans=0
for i in range(5):
  if list[i]%10 != 0:
    if list[i]%10 < worst:
      worst = list[i]%10
      flag=i
for i in range(5):
  if i == flag:
    ans += list[i]
  elif list[i]%10 == 0:
    ans += list[i]
  else:
    ans += (list[i] + 10-list[i]%10)
print(ans)
N=int(input())
A=list(input()for i in range(N))
if len(A)==len(set(A):
    if all(A[i][-1]==A[i+1][0]) for i in range(N-1):
        print('Yes')
    else:print('No')
else:print('No')

### FIXED CODE ###

N=int(input())
A=list(input()for i in range(N))
if len(A)==len(set(A)):
    if all(A[i][-1]==A[i+1][0] for i in range(N-1)):
        print('Yes')
    else:print('No')
else:print('No')
n = int(input())

n = n[-1]

if n in [2, 4, 5, 7, 9]:
  ans = 'hon'
elif n in [0, 1, 6, 8]:
  ans = 'pon'
else:
  ans = 'bon'
print(ans)

### FIXED CODE ###

n = input()
n = int(n[-1])

if n in [2, 4, 5, 7, 9]:
  ans = 'hon'
elif n in [0, 1, 6, 8]:
  ans = 'pon'
else:
  ans = 'bon'
print(ans)
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ax = 0
for aa in range(a+1):
    for bb in range(b+1):
    	for cc in range(c+1):
      		if aa * 500 + bb * 100 + cc * 50 == X:
        		ax += 1
print(ax)


### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
x = int(input())
ax = 0
for aa in range(a+1):
  for bb in range(b+1):
    for cc in range(c+1):
      if aa * 500 + bb * 100 + cc * 50 == x:
        ax += 1
print(ax)