Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
for i in range(1,n+1):
    print(a.count(i))

### FIXED CODE ###

from collections import Counter
n = int(input())
a = list(map(int,input().split()))
acou = Counter(a)
for i in range(1,n+1):
    print(acou[i])
### BUGGY CODE ###

n = int(input())
s = input()
ans = 0

for i in range(0,1000):
    num = str(i)
    if i < 10:
        num = "00"+num
    elif i <100:
        num = "0" + num
    f = 0
    for j in range(n):
        if s[j] == num[f]:
            f += 1
        if f == 3:
            break
    if f==3:
        ans +=1
print(ans)
                        


### FIXED CODE ###

n = int(input())
s = input()
ans = 0

for i in range(0,1000):
    num = str(i)
    if i < 10:
        num = "00"+num
    elif i <100:
        num = "0" + num
    f = 0
    for j in range(n):
        if s[j] == num[f]:
            f += 1
        if f == 3:
            break
    if f==3:
        ans +=1
print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
S = input().rstrip()

def ctoi(c):
    return ord(c) - ord('a')

cums = [0]
for c in S:
    cums.append(cums[-1] ^ (1<<ctoi(c)))
if cums[-1] == 0:
    print(1)
    exit()

dp = {0:0}
for i,b in enumerate(cums):
    for k in range(26):
        msk = b^(1<<k)
        if msk in dp:
            if b in dp:
                dp[b] = min(dp[b], dp[msk]+1)
            else:
                dp[b] = dp[msk]+1
print(dp[cums[-1]])

### FIXED CODE ###

def ctoi(c):
    return ord(c) - ord('a')

def solve(s):
    masks = [1<<k for k in range(26)]
    cums = [0]
    for c in s:
        cums.append(cums[-1] ^ masks[ctoi(c)])
    if cums[-1] == 0:
        print(1)
        exit()

    dp = {0:0}
    for b in cums:
        for m in masks:
            msk = b^m
            if msk in dp:
                if b in dp:
                    dp[b] = min(dp[b], dp[msk]+1)
                else:
                    dp[b] = dp[msk]+1
    return dp[cums[-1]]

print(solve(input()))
### BUGGY CODE ###

N, K = map(int,input().split(' '))
stage = list(map(int, input().split(" ")))

INF = float('inf')
DP = [INF for i in range(N)]
#DP[0] = 0
candidate = []

for i in range(N):
    if i == 1:
        DP[i] = abs(stage[i] - stage[i-1])
    elif i > 1:
        for j in range(min(K+1,i+1)):
            if i == j:
                candidate.append(abs(stage[i]-stage[0]))
            else:
                candidate.append(DP[i-j] + abs(stage[i]-stage[i-j]))
        DP[i] = min(candidate)
        candidate.clear()

print(DP[N-1])

### FIXED CODE ###

N, K = map(int,input().split(' '))
stage = list(map(int, input().split(" ")))

INF = float('inf')
DP = [INF for i in range(N)]
#DP[0] = 0


for i in range(N):
    candidate = [INF for i in range(K)]
    if i == 1:
        DP[i] = abs(stage[i] - stage[i-1])
    elif i > 1:
        for j in range(min(K+1,i+1)):
            if i == j:
                candidate[0] = (abs(stage[i]-stage[0]))
            else:
                candidate[K-1-j]=(DP[i-j] + abs(stage[i]-stage[i-j]))
        DP[i] = min(candidate)

print(DP[N-1])
### BUGGY CODE ###

N,K = map(int,input().split())
h = [0]+list(map(int,input().split()))
dp = [10**10]*(N+1)
dp[1] = 0
for i in range(1,N+1):
    for j in range(1,K+1):
        if i-j>0:
            dp[i] = min(dp[i-j]+abs(h[i]-h[i-j]),dp[i])
        else:
            break
print(dp[N])


### FIXED CODE ###

N,K = map(int,input().split())
h = [0]+list(map(int,input().split()))
dp = [10**10]*(N+1)
dp[1] = 0
for i in range(1,N+1):
    for j in range(1,K+1):
        if i-j>0:
            dp[i] = min(dp[i-j]+abs(h[i]-h[i-j]),dp[i])
        else:
            break
print(dp[N])
### BUGGY CODE ###

n,m=map(int,input().split(" "))
l=[]
bone=[]
ans="IMPOSSIBLE"
for i in range(m):
		a,b=input().split(" ")
		if a=="1":l.append(b)
		if b==str(n):bone.append(a)
for i in l:
	for j in bone:
		if i == j:
			ans="POSSIBLE"
print(ans)

### FIXED CODE ###

n,m=map(int,input().split(" "))
l=[]
bone=[]
for i in range(m):
		a,b=input().split(" ")
		if a=="1":l.append(b)
		if b==str(n):bone.append(a)

ans=list(set(l) & set(bone))
if len(ans)!=0:
	print("POSSIBLE")
else:			
	print("IMPOSSIBLE")
### BUGGY CODE ###

s = input()

dp = [0 for i in range(2019)]
dp2 = [0 for i in range(2019)]
ans = 0
for i in range(len(s)):
    for j in range(2019):
        dp2[(10*j + int(s[i])) % 2019] += dp[j]
    dp2[int(s[i])] += 1
    dp = dp2[:]
    dp2 = [0 for i in range(2019)]
    # print(dp)
    ans += dp[0]

print(ans)

### FIXED CODE ###

s = input()

dp = [0] * 2019
dp2 = [0] * 2019
ans = 0
for i in s:
    i = int(i)

    for j in range(2019):

        dp2[(10*j + i) % 2019] += dp[j]
    dp2[i] += 1
    dp = dp2[:]
    dp2 = [0] * 2019
    # print(dp)
    ans += dp[0]

print(ans)
### BUGGY CODE ###

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

import sys
import os

n, q = map(int, input().split())

scores = [0 for i in range(n)]
for i in range(q):
    a, v = map(int, input().split())

    # add
    a -= 1
    scores[a] += v

    max_value = max(scores)
    max_index = scores.index(max_value)

    print(max_index + 1, max_value)

### FIXED CODE ###

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

import sys
import os


n, q = map(int, input().split())
scores = [0] * n

max_value = 0
max_index = 0
for i in range(q):
    a, v = map(int, input().split())

    # zero index
    a -= 1
    scores[a] += v

    # need speed than naive implementation

    if max_index == a and v < 0:
        max_value = max(scores)
        max_index = scores.index(max_value)

    elif max_value < scores[a]:
        max_index = a
        max_value = scores[a]

    elif max_value == scores[a] and a < max_index:
        max_index = a

    print(max_index + 1, max_value)
### BUGGY CODE ###

#----グローバル変数----
INF = 10**10 #無限大（最小化問題の場合）
dp=[]       #DPテーブル

h=[]   #足場の高さ
#----------------------

#----関数----

#DPテーブル更新関数　最小化用＆最大化用
def chmin(dp, idx, new_val):
    if dp[idx] > new_val:
        dp[idx] = new_val
        return True
    return False

def chmax(dp, idx, new_val):
    if dp[idx] < new_val:
        dp[idx] = new_val
        return True
    return False
#------------


#----実行開始----
# 入力
n,k = map(int, input().split())

s = input()
h = [int(x) for x in s.split()]

# DPテーブル初期化 (最小化問題なので INF に初期化)
for i in range(n+k-1):
    dp.append(INF)

#配るタイプなので、hをk-1分延長しておく
for i in range(k-1):
    h.append(0)

# 初期条件
dp[0] = 0;

# ジャンプのループ
for i in range(0,n-1):
    for j in range(1,k+1):
        # jp check    
        jpcost = abs(h[i]-h[i+j])
        chmin(dp,i+j,dp[i]+jpcost)

# 出力
print(dp[n-1])

#---------------


### FIXED CODE ###

#----グローバル変数----
INF = 10**10 #無限大（最小化問題の場合）
dp=[]       #DPテーブル

h=[]   #足場の高さ
#----------------------

#----関数----

#DPテーブル更新関数　最小化用＆最大化用
def chmin(dp, idx, new_val):
    if dp[idx] > new_val:
        dp[idx] = new_val
        return True
    return False

def chmax(dp, idx, new_val):
    if dp[idx] < new_val:
        dp[idx] = new_val
        return True
    return False
#------------


#----実行開始----
# 入力
n,k = map(int, input().split())

s = input()
h = [int(x) for x in s.split()]

# DPテーブル初期化 (最小化問題なので INF に初期化)
for i in range(n):
    dp.append(INF)

# 初期条件
dp[0] = 0;

# ジャンプのループ
for i in range(1,n):
    farthest = max(0,i-k)
    for j in range(farthest,i):
        # jp check    
        jpcost = abs(h[j]-h[i])
        chmin(dp,i,dp[j]+jpcost)

# 出力
print(dp[n-1])

#---------------
### BUGGY CODE ###

from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n, m = map(int, input().split())
    a = list(map(int, input().split()))

    for _ in range(m):
        a.sort()
        a[-1] = a[-1] // 2

    print(sum(a))


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()


### FIXED CODE ###

from sys import stdin, setrecursionlimit
from heapq import heapify, heappop, heappush


def main():
    input = stdin.buffer.readline
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    a = [-ai for ai in a]
    heapify(a)

    for _ in range(m):
        tmp = -heappop(a)
        heappush(a, -(tmp // 2))

    print(-sum(a))


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()
### BUGGY CODE ###

n, m = map(int, input().split()) 
s = list(map(int, input().split())) 
t = list(map(int, input().split())) 

MOD = 1000000007

dp= [[0] * m for _ in range(n)] 

for i, si in enumerate(s):  
  for j, tj in enumerate(t):
    if i > 0:
      dp[i][j] += dp[i-1][j]
      
    if j > 0:
      dp[i][j] += dp[i][j-1]

    if si == tj:
      dp[i][j] += 1
    elif i > 0 and j > 0:
      dp[i][j] -= dp[i-1][j-1]
    
    dp[i][j] %= MOD

print((dp[n-1][m-1] + 1) % MOD)

### FIXED CODE ###

n, m = map(int, input().split()) 
s = list(map(int, input().split())) 
t = list(map(int, input().split())) 

MOD = 1000000007

dp= [[0] * m for _ in range(n)] 

for i, si in enumerate(s):  
  for j, tj in enumerate(t):
    if i > 0:
      dp[i][j] += dp[i-1][j]
      
    if j > 0:
      dp[i][j] += dp[i][j-1]

    if si == tj:
      dp[i][j] += 1
    elif i > 0 and j > 0:
      dp[i][j] -= dp[i-1][j-1]
    
    dp[i][j] %= MOD

print((dp[n-1][m-1] + 1) % MOD)
### BUGGY CODE ###

import numpy as np
N=int(input())
A=list(map(int,(input().split())))
npArray = np.array(A)
npArray=npArray.copy()
ans=np.sum(npArray)
Q=int(input())

for i in range(Q):
  L, R = map(int,(input().split()))
  B_count=np.count_nonzero(npArray == L)
  sa=(R-L)*B_count
  npArray = np.where(npArray == L,R, npArray)
  ans= ans+sa
  print(ans)

### FIXED CODE ###

import collections
import copy
N=int(input())
A=list(map(int,(input().split())))
ans=sum(A)
Q=int(input())
col = collections.Counter(A)

for i in range(Q):
  L, R = map(int,(input().split()))
  sa=(R-L)*col[L]
  col[R]+=copy.copy(col[L])
  col[L]=0
  ans= ans+sa
  print(ans)
### BUGGY CODE ###

# ===================================
# (c) MidAndFeed aka ASilentVoice
# ===================================
# import math 
# import collections
# import string
# ===================================
n, k = [int(x) for x in input().split()]
q = [int(x) for x in input().split()]
ans = [0]

for i in range(1, n):
	t = int(1e9)
	for j in range(1, k+1):
		if i-j >= 0: t = min(t, ans[i-j] + abs(q[i-j] - q[i]))

	ans.append(t)

print(ans[n-1])


### FIXED CODE ###

# ===================================
# (c) MidAndFeed aka ASilentVoice
# ===================================
# import math 
# import collections
# import string
# ===================================
import numpy as np
n, k = [int(x) for x in input().split()]
q = np.array([int(x) for x in input().split()])
ans = np.zeros(n, dtype=int)

for i in range(1, n):
	start = max(0, i-k)
	ans[i] = min(ans[start:i] + np.abs(q[i] - q[start:i]))

print(ans[n-1])
### BUGGY CODE ###

#coding: utf-8
from math import ceil, floor
X = int(input())
a = floor(X**(1/5))
a2 = -a
while True:
    a2 = -a
    b = (a**5 - X)
    b2 = (a2**5 - X)
    if a**5 - b**5 == X:
        print(a,b)
        exit()
    elif a2**5 - b2**5 == X:
        print(a2, b2)
    a += 1



### FIXED CODE ###

#coding: utf-8
X = int(input())
for a in range(-118, 120, 1):
    for b in range(-118, 120, 1):
        if a ** 5 - b ** 5 == X:
            print(a, b)
            exit()
### BUGGY CODE ###

N=int(input())
res=0
while N>0:
    mod=N%10
    N=N//10
    res+=mod
if res%9==0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N=input()
nlist=list(map(int,N))
if sum(nlist)%9==0:
    print('Yes')
else:
    print('No')
### BUGGY CODE ###

r1, c1, r2, c2 = list(map(int, input().split()))

MOD = 10 ** 9 + 7


def nCr(n, r):
    num = den = 1
    for i in range(r):
        num = num * (n - i)
        den = den * (i + 1)
    return num // den


def hockey(n, m):
    # sum i=0 to m of nCr(n + i, i) == nCr(n + m + 1, m)
    return nCr(n + m + 1, m)


if False:

    def f(r, c):
        return nCr(r + c, c)

    tot = 0
    for r in range(r1, r2 + 1):
        innerLoopSum = 0
        for c in range(c1, c2 + 1):
            innerLoopSum += f(r, c)
        # Via hockey stick identity
        assert innerLoopSum == nCr(r + c2 + 1, c2) - nCr(r + c1 - 1 + 1, c1 - 1)
        assert innerLoopSum == nCr(r + c2 + 1, r + 1) - nCr(r + c1, r + 1)
        tot += innerLoopSum
    print(tot)
    
    tot1 = 0
    for r in range(r1 + 1, r2 + 2):
        tot1 += nCr(r + c2, r)
    assert tot1 == hockey(c2, r2 + 1) - hockey(c2, r1)
    tot2 = 0
    for r in range(r1 + 1, r2 + 2):
        tot2 += nCr(r + c1 - 1, r)
    assert tot2 == hockey(c1 - 1, r2 + 1) - hockey(c1 - 1, r1)
    print((tot1 - tot2) % MOD)
else:
    tot1 = hockey(c2, r2 + 1) - hockey(c2, r1)
    tot2 = hockey(c1 - 1, r2 + 1) - hockey(c1 - 1, r1)
    print((tot1 - tot2) % MOD)

### FIXED CODE ###

r1, c1, r2, c2 = list(map(int, input().split()))

MOD = 10 ** 9 + 7


def modInverse(x, p):
    # Fermat's little theorem
    return pow(x, p - 2, p)


def nCr(n, r, p):
    num = den = 1
    for i in range(r):
        num = (num * (n - i)) % p
        den = (den * (i + 1)) % p
    return num * modInverse(den, p) % p


def hockey(n, m):
    # sum i=0 to m of nCr(n + i, i) == nCr(n + m + 1, m)
    return nCr(n + m + 1, m, MOD)


tot1 = hockey(c2, r2 + 1) - hockey(c2, r1)
tot2 = hockey(c1 - 1, r2 + 1) - hockey(c1 - 1, r1)
print((tot1 - tot2) % MOD)
### BUGGY CODE ###

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

  #行ったことある町リスト
  d=[1]
  for _ in range(K):
    T=A[d[-1]-1]
    if T in d:
      break
    d.append(T)
  F=d.index(T)
  LOOP_TOWN=d[F:]
  q=(K-F)%len(LOOP_TOWN)
  print(LOOP_TOWN[q])

if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
  N,K=map(int,input().split())
  A=list(map(int,input().split()))
  n=[0]*N
  #行ったことある町リスト
  d=[1]
  for _ in range(K):
    T=A[d[-1]-1]
    if n[T-1]==1:
      break
    else:
      n[T-1]=1
    d.append(T)
  F=d.index(T)
  LOOP_TOWN=d[F:]
  q=(K-F)%len(LOOP_TOWN)
  print(LOOP_TOWN[q])

if __name__ == "__main__":
    main()
### BUGGY CODE ###




from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
    
ns = defaultdict(set)
for _ in range(n-1):
    u,v = [int(c) for c in input().split()]
    ns[u-1].add(v-1)
    ns[v-1].add(u-1)

from bisect import bisect_left
 
l = [a[0]]
# for a in A[1:]:
#     if a > L[-1]:
#         # Lの末尾よりaが大きければ増加部分列を延長できる
#         L.append(a)
#     else:
#         # そうでなければ、「aより小さい最大要素の次」をaにする
#         # 該当位置は、二分探索で特定できる
#         L[bisect_left(L, a)] = a
# return len(L)

q = [(0, -1, l)]
ans = [None] * n
while q:
    u, prev, lst = q.pop()
    ans[u] = len(lst)
    for v in ns[u]:
        if prev==v:
            continue
        aa = a[v]
        if aa > lst[-1]:
            tmp = lst + [aa]
        else:
            tmp = list(lst)
            tmp[bisect_left(lst, aa)] = aa
#         print(tmp)
        q.append((v, u, tmp))
print("\n".join(map(str, ans)))

### FIXED CODE ###


from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))

import sys
sys.setrecursionlimit(max(1000, 2*n))


ns = defaultdict(set)
for _ in range(n-1):
    u,v = [int(c) for c in input().split()]
    ns[u-1].add(v-1)
    ns[v-1].add(u-1)

from bisect import bisect_left
 
l = [a[0]]
# for a in A[1:]:
#     if a > L[-1]:
#         # Lの末尾よりaが大きければ増加部分列を延長できる
#         L.append(a)
#     else:
#         # そうでなければ、「aより小さい最大要素の次」をaにする
#         # 該当位置は、二分探索で特定できる
#         L[bisect_left(L, a)] = a
# return len(L)

ans = [None] * n

def sub(u, prev, lst, old, ind, ans):
    aa = a[u]
    if len(lst)==0 or aa > lst[-1]:
        lst.append(aa)
        old = -1
        ind = None
    else:
        ind = bisect_left(lst, aa)
        old = lst[ind]
        lst[ind] = aa
    ans[u] = len(lst)
#     print(lst)
    for v in ns[u]:
        if prev==v:
            continue
        sub(v, u, lst, old, ind, ans)
    if old==-1:
        lst.pop()
    elif old is not None:
        lst[ind] = old

lst = []
sub(0, -1, lst, None, None, ans)
print("\n".join(map(str, ans)))
### BUGGY CODE ###

from functools import reduce
import operator
import heapq
def SME(start,end):
    A = []
    if end > N : end = N
    count = 0
    for i,x in enumerate(Whole[start:end]):
        heapq.heappush(A,[x,i])
    for j in range(start,end):
        a = heapq.heappop(A)
        for i in range(L):
            idx = a[1] + i
            try :
                if not ANS[idx]:
                    ANS[idx] = a[0]
                    count += 1
            except IndexError : continue
        if count > N * parameter : break
    for i in range(L):
        if not ANS[i] : ANS[i] = min(Whole[:i+1])
    for i in range(L,N):
        if not ANS[i] : ANS[i] = min(Whole[i+1-L:i+1])
    return ANS

[N,L] = [int(x) for x in input().split()]
Whole = [int(x) for x in input().split()]
parameter = 0.997
INIT = None
ANS = [INIT]*N
ANS = SME(0, N)
for i in ANS[L-1:-1]:print(i, end=" ")
print(ANS[-1])

### FIXED CODE ###

def ascend(a,b):
    mini = min(A[a:a+L])
    ans[a] = mini
    for i in range(a+1,b):
        if A[i+L-1] <= mini : mini = A[i+L-1]
        elif A[i-1] == mini : mini = min(A[i:i+L])
        ans[i] = mini

def descend(a,b):
    mini = min(A[b-1:b+L-1])
    ans[b-1] = mini
    for i in range(b-2,a-1,-1):
        if A[i] <= mini : mini = A[i]
        elif A[i+L] == mini: mini = min(A[i:i+L])
        ans[i] = mini
    
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = [None]*(N-L+1)
count = 0;
if N > 10 ** 4:
    for i in range(100):
        if A[i+1] > A[i] : count += 1
    if count > 80 : descend(0, N-L+1)
    else : ascend(0,N-L+1)
else :
    ascend(0, N-L+1)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])
### BUGGY CODE ###

import sys
s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in ss]
ss2nnn = lambda ss: [s2nn(s) for s in ss]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]
ii2sss = lambda n: [list(sys.stdin.readline().rstrip()) for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

# random_denseがTLE, 他はAC
from bisect import bisect_left, bisect_right  # 二分探索
def main_tle():
    N, Q = i2nn()
    STX = ii2nnn(N) # 座標 X で時刻 [S, T) が工事
    D = ii2nn(Q)    # 昇順ソート済み
    E = [-1] * Q
    STX.sort(key=lambda v: v[2])
    for s, t, x in STX:
        a = bisect_left(D, s-x)
        b = bisect_left(D, t-x)
        for i in range(a, b):
            if E[i] == -1:
                E[i] = x
    for e in E:
        print(e)

def main():
    N, Q = i2nn()
    STX = ii2nnn(N) # 座標 X で時刻 [S, T) が工事
    D = ii2nn(Q)    # 昇順ソート済み

    events = []
    for i, d in enumerate(D):
        events.append(('D', d, i))
    for s, t, x in STX:
        events.append(('S', s-x-0.25, x))
        events.append(('T', t-x-0.75, x))  # 0.5 同士だと [1, 2), [0, 1) で吹き飛ぶ
    
    ans = [-1] * Q
    events.sort(key=lambda v: v[1])
    xset = set()
    #xmin = None
    xmin = 1e+10
    xb = False
    for event, time, xi in events:
        if event == 'S':
            xset.add(xi)
            #if xmin is None or xmin > xi:
            if xmin > xi:
                xmin = xi
                xb = True
        elif event == 'T':
            xset.remove(xi)
            if xmin == xi:
                #xmin = None
                xb = False
        elif event == 'D' and xset:
            #if xmin is None:
            if not xb:
                xmin = min(xset)
            ans[xi] = xmin

    for n in ans:
        print(n)

main()


### FIXED CODE ###

import sys;input=sys.stdin.readline

n,q=map(int, input().split())
event=[]
for _ in range(n):
    s,t,x=map(int,input().split())
    event.append((s-x-0.5,1,x))
    event.append((t-x-0.5,-1,x))
for i in range(q):
    event.append((int(input()),0,i))

event.sort()
is_stop=False
stop=set()
minstop=float('inf')
ans=[-1]*q
for t,e,x in event:
    if e > 0:
        stop.add(x)
        if x<minstop:
            minstop=x
            is_stop=True
    elif e<0:
        stop.remove(x)
        if minstop==x:
            is_stop=False
    elif len(stop)>0:
        if not is_stop:
             minstop=min(stop)
             is_stop=True
        ans[x]=minstop

print('\n'.join(map(str, ans)))
### BUGGY CODE ###

h, n = map(int, input().split())
magic = [list(map(int, input().split())) for _ in range(n)]
hls = [0]
for i in range(h + max(magic, key = lambda x:x[0])[0]):
    pre = []
    for j in range(n):
        hres = i + 1 - magic[j][0]
        if hres >= 0:
            pre.append(hls[hres] + magic[j][1])
        else:
            pre.append(magic[j][1])
    hls.append(min(pre))
print(min(hls[h:]))

### FIXED CODE ###

h, n = map(int, input().split())
magic = [list(map(int, input().split())) for _ in range(n)]
hls = [0]
for i in range(h + max(magic, key = lambda x:x[0])[0]):
    pre = []
    for j in range(n):
        hres = i + 1 - magic[j][0]
        if hres >= 0:
            pre.append(hls[hres] + magic[j][1])
        else:
            pre.append(magic[j][1])
    hls.append(min(pre))
print(min(hls[h:]))
### BUGGY CODE ###

from itertools import product


def read():
    N, K = list(map(int, input().strip().split()))
    H = list(map(int, input().strip().split()))
    return N, K, H

def solve(N, K, H, INF=10**9):
    dp = [INF for i in range(N)]
    dp[0] = 0
    for i, k in product(range(1, N), range(1, K+1)):
        if 0 <= i - k:
            dp[i] = min(dp[i], dp[i-k] + abs(H[i] - H[i-k]))
    return dp[N-1]

if __name__ == '__main__':
    inputs = read()
    print("%s" % solve(*inputs))


### FIXED CODE ###

from itertools import product


def read():
    N, K = list(map(int, input().strip().split()))
    H = list(map(int, input().strip().split()))
    return N, K, H

def solve(N, K, H, INF=10**9):
    dp = [INF for i in range(N)]
    dp[0] = 0
    for i, k in product(range(1, N), range(1, K+1)):
        if 0 <= i - k:
            dp[i] = min(dp[i], dp[i-k] + abs(H[i] - H[i-k]))
    return dp[N-1]

if __name__ == '__main__':
    inputs = read()
    print("%s" % solve(*inputs))
### BUGGY CODE ###

n,ma,mb = (int(i) for i in input().split())
dp = [[[float("inf") for i in range(10*n+1)] for i in range(10*n+1)] for i in range(n+1)]
dp[0][0][0],ans = 0,float("inf")
for i in range(1,n+1):
	x,y,c = (int(l) for l in input().split())
	for j in range(10*(i-1)+1):
		for k in range(10*(i-1)+1):
			if dp[i-1][j][k]!=float("inf"):
				dp[i][j][k] = min(dp[i-1][j][k],dp[i][j][k])
				dp[i][j+x][k+y] = min(dp[i][j+x][k+y],dp[i-1][j][k]+c)
for i in range(ma,10*n+1,ma):
	if i*mb//ma<=10*n: ans=min(ans,dp[n][i][i*mb//ma])
if ans==float("inf"): print(-1)
else: print(ans)

### FIXED CODE ###

n, ma, mb = map(int, input().split())
INF = float("inf")
dp = [[[INF for i in range(10*n+1)] for i in range(10*n+1)] for i in range(n+1)]
dp[0][0][0],ans = 0,INF
for i in range(1,n+1):
    a,b,c = (int(l) for l in input().split())
    for j in range(10*(i-1)+1):
        for k in range(10*(i-1)+1):
            if dp[i-1][j][k] != INF:
              dp[i][j][k] = min(dp[i][j][k], dp[i-1][j][k])
              dp[i][j+a][k+b] = min(dp[i][j+a][k+b], dp[i-1][j][k]+c)
for i in range(ma,10*n+1,ma):
	if i*mb//ma<=10*n: ans=min(ans,dp[n][i][i*mb//ma])
if ans==INF: print(-1)
else: print(ans)
### BUGGY CODE ###

import numpy as np

N = int(input())
A = np.array([int(i) for i in input().split()])
ans = 0
for a in A:
    candi = [
        np.sum(np.abs(A - np.ones(N) * (a - 1)) <= 1),
        np.sum(np.abs(A - np.ones(N) * a) <= 1),
        np.sum(np.abs(A - np.ones(N) * (a + 1)) <= 1),
    ]
    ans = max(ans, np.max(candi))
print(ans)


### FIXED CODE ###

import numpy as np
N = int(input())
temp = input()
a = np.array([int(i) for i in temp.split()])

list_X = [0]*1000000

for ele in a:
    list_X[ele] += 1
    list_X[ele-1] += 1
    list_X[ele+1] += 1

print(max(list_X))