Harryxun/stf_run huggingface dataset:
n, k = map(int, input().split())
a = list(map(int, input().split()))

def solve():
  a.sort()
  c = [a.count(i) for i in range(1,n+1) if a.count(i)>0]
  c.sort()
  if(len(count)<=k):
    print(0)
  else:
    print(sum(count[:len(c)-k]))

solve()
  
  

### FIXED CODE ###

import collections

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

def solve():
  c = list(collections.Counter(a).values())
  c.sort()
  if(len(c)<=k):
    print(0)
  else:
    print(sum(c[:len(c)-k]))

solve()
w,h,n = map(int,input().split())
paint = [list(map(int,input().split())) for _ in range(n)]
x1,x2,y1,y3 = 0,w,0,h
for p in paint:
    if p[2] == 1:
        x1 = p[0]
    elif p[2] == 2:
        x2 = p[0]
    elif p[2] == 3:
        y1 = p[1]
    else:
        y2 = p[1]
print( max(0,(x2-x1)*(y2-y1)))


### FIXED CODE ###

w,h,n = map(int,input().split())
paint = [list(map(int,input().split())) for _ in range(n)]
x1,x2,y1,y2 = 0,w,0,h
for p in paint:
    if p[2] == 1:
        x1 = max(x1,p[0])
    elif p[2] == 2:
        x2 = min(x2,p[0])
    elif p[2] == 3:
        y1 = max(y1,p[1])
    else:
        y2 = min(y2,p[1])
print(0 if x1>x2 or y1>y2 else (x2-x1)*(y2-y1))
n = int(input())
s = str(input())
len_s = range(n)

for i in len_s:
    if s[i] == "#":
        s = s[i::]
        break
count_sharp = s.count("#")
count_dot = s.count(".")
if min(count_dot, count_sharp) == 0:
    print(0)
else:
    print(min(count_dot, count_sharp))



### FIXED CODE ###

points = input()
points = points.split(" ")
a = int(points[0])
b = int(points[1])
c = int(points[2])

if (a < b) and (a < c) and (c < b):
    print("Yes")
elif (a > b) and (a > c) and (c > b):
    print("Yes")
else:
    print("No")
n = input()
A = map( int , raw_input().split() )
q = input()
mi = map( int , raw_input().split() )

def solve(i, m):
  if m == 0:
    return True
  if i >= n:
    return False
res = solve( i+1 , m ) or solve( i+1 , m-A[i] )
return res

for m in mi:
  if solve( 0 , m ):
    print 'yes'
  else:
    print 'no'
   

### FIXED CODE ###

n = input()
A = map( int , raw_input().split() )
q = input()
mi = map( int , raw_input().split() )

def solve(i, m):
  if m == 0:
    return True
  elif i >= n or m > sum(A):
    return False

  res = solve( i+1 , m ) or solve( i+1 , m-A[i] )
  return res

for m in mi:
  if solve( 0 , m ): print "yes"
  else: print "no"
Dance = input()
i = 0
flag = 0
for char in Dance:
  if i%2 == 0:
    if char == R:
      flag = 1
      break
  else:
    if char == L:
      flag = 1
      break
  i+=1
  
if flag == 0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

Dance = input()
i = 0
flag = 0
for char in Dance:
  if i%2 == 1:
    if char == "R":
      flag = 1
      break
  else:
    if char == "L":
      flag = 1
      break
  i+=1
  
if flag == 0:
  print("Yes")
else:
  print("No")
import sys

sys.setrecursionlimit(100000)
N, Q = map(int, input().split())
A, B = [], []

edges = [[] for _ in range(N + 1)]
nums = [0 for _ in range(N + 1)]
for _ in range(N - 1):
    a, b = map(int, input().split())
    edges[a].append(b)
    edges[b].append(a)

for _ in range(Q):
    p, x = map(int, input().split())
    nums[p] += x


def dfs(now, parent):
    for i in edges[now]:
        if i != parent:
            nums[i] += nums[now]
            dfs(i, now)


dfs(1, 0)
for n in nums[1:]:
    print(n)


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def main():
    N, Q = map(int, input().split())

    edges = [[] for _ in range(N + 1)]
    nums = [0 for _ in range(N + 1)]
    for _ in range(N - 1):
        a, b = map(int, input().split())
        edges[a].append(b)
        edges[b].append(a)

    for _ in range(Q):
        p, x = map(int, input().split())
        nums[p] += x

    def dfs(now, parent):
        for i in edges[now]:
            if i != parent:
                nums[i] += nums[now]
                dfs(i, now)

    dfs(1, 0)
    for n in nums[1:]:
        print(n)


if __name__ == "__main__":
    main()
x = int(input())
if x==1:
  print(0)
else if x==0:
  print(1)

### FIXED CODE ###

x = int(input())
if x==1:
  print(0)
  
else:
  print(1)
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
count = 0
for i in range(N-1):
    if A[i] <= A[i+1] : count += 1
if count > N * 0.9 : print(1)
ans = []
mini = min(A[0:L])
ans.append(mini)
for i in range(1,N-L+1) :
    if A[i+L-1] <= mini :
        mini = A[i+L-1]
    elif A[i-1] == mini :
        mini = min(A[i:i+L])
    ans.append(mini-mean)
for i in ans[:-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])
n,m=map(int,input().split())
a=sorted(map(int,input().split()))
l=list()
for i in range(m):
    l.append(list(map(int,input().split())))
l.sort(key=lambda x:-x[1])
i=0
for b,c in l:
    for j in range(b):
        if a[i+j]<c:
            a[i+j]=c
        else:
            print(sum(a))
            exit()
    i+=b
print(sum(a))

### FIXED CODE ###

n,m=map(int,input().split())
a=sorted(map(int,input().split()))
l=list()
for i in range(m):
    l.append(list(map(int,input().split())))
l.sort(key=lambda x:-x[1])
i=0
for b,c in l:
    for j in range(b):
        if i+j<n and a[i+j]<c:
            a[i+j]=c
        else:
            print(sum(a))
            exit()
    i+=b
print(sum(a))
n=int(input())

l=[2,1]
for i in range(2,86):
  l.append(l[i-1]+l[i-2])

print(l[n])

### FIXED CODE ###

n=int(input())

l=[2,1]
for i in range(2,87):
  l.append(l[i-1]+l[i-2])

print(l[n])
N = list(int(input()).split())
c = 0

for n in N:
  c += n

if c % 9 == 0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N = list(input())
c = 0

for n in N:
  c += int(n)

if c % 9 == 0:
  print('Yes')
else:
  print('No')
import sys
#import clipboard

#if sys.platform == 'ios':
#	input = clipboard.get()
#else: 
	input = input()

arr = input.split()

X, Y, Z = arr
print(Z, X, Y)

	

### FIXED CODE ###

x, y, z = input().split()
print(z, x, y)
N = int(input())
X = list(map(int, input().split()))

def D(X,a):
	ans = 0
	for i in range(len(a)):
		ans += (x - a[i])**2
	return ans

for i in range(0,101):
	if D(i,X) < D(i+1,X):
		print(D(i,X))
		break

### FIXED CODE ###

N=int(input())
X=list(map(int,input().split()))
def D(x,a):
	ans=0
	for i in range(len(a)):
		ans+=(x-a[i])**2
	return ans
for i in range(0,101):
	if D(i,X)<D(i+1,X):
		print(D(i,X))
		break
a, b, c = map(str, input().split(,))

print(a+''+b+''+c)

### FIXED CODE ###

s = str(input())
ans = ''

for i in range(19):
    
    if i==5 or i==13:
        ans += ' '

    else:
        ans += s[i]

print(ans)
k=list(map(str,input().split()))
print(int(max(k)+max(k)[1])+int(min(k)))


### FIXED CODE ###

k=list(map(str,input().split()))
k.sort()
l=str(k[2])+str(k[1])
print(int(l)+int(k[0]))
S = input()
T = input()
ans = "Yes"
start = [-1]*26
goal = [-1]*26
for i in range(len(S)):
    s,t = ord(S[i])-96,ord(T[i])-96
    if start[s]!=-1 or goal[t]!=-1:
        if start[s]!=t or goal[t]!=s:
            ans = "No"
    else:
        start[s] = t
        goal[t] = s
print(ans)

### FIXED CODE ###

S = input()
T = input()
ans = "Yes"
start = [-1]*27
goal = [-1]*27
for i in range(len(S)):
    s,t = ord(S[i])-96,ord(T[i])-96
    if start[s]!=-1 or goal[t]!=-1:
        if start[s]!=t or goal[t]!=s:
            ans = "No"
    else:
        start[s] = t
        goal[t] = s
print(ans)
import sys

import numpy as np


def main():
    N = int(input())
    red = np.zeros([N, 3])
    blue = np.zeros([N, 3])

    for i in range(N):
        red[i, 0:2] = list(map(int, input().split()))

    for i in range(N):
        blue[i, 0:2] = list(map(int, input().split()))

    blue[:, 2] = blue[:, 0] + blue[:, 1]
    blue = blue[np.argsort(blue[:, 2])]

    red[:, 2] = red[:, 0] + red[:, 1]
    red = red[np.argsort(blue[:, 2])]

    d = np.zeros([N, 2])
    cnt = 0

    for i in range(N):
        d[0:N, 0] = blue[i, 0] - red[0:N, 0]
        d[0:N, 1] = blue[i, 1] - red[0:N, 1]

        if np.any(d[:, 0] > 0) and np.any(d[:, 1] > 0):
            dd = d[(d[:, 0] > 0) & (d[:, 1] > 0)]
            ind = np.where(d == dd[-1])
            row = ind[0][0]
            red[row, :] = 10**9
            cnt += 1

    print(cnt)


main()


### FIXED CODE ###

import numpy as np


def main():
    N = int(input())
    red = np.zeros([N, 2])
    blue = np.zeros([N, 2])

    for i in range(N):
        red[i, 0:2] = list(map(int, input().split()))

    for i in range(N):
        blue[i, 0:2] = list(map(int, input().split()))

    blue = blue[np.argsort(blue[:, 0])]
    red = red[np.argsort(red[:, 1])[::-1]]

    d = np.zeros([N, 2])
    cnt = 0

    for i in range(N):
        d[0:N, 0:2] = blue[i, 0:2] - red[0:N, 0:2]

        if np.any((d[:, 0] > 0) & (d[:, 1] > 0)):
            dd = d[(d[:, 0] > 0) & (d[:, 1] > 0)]
            dd = dd[np.argsort(dd[:, 1])]
            ind = list(zip(*np.where(d == dd[0])))
            row = ind[0][0]
            red[row, :] = 10**9
            cnt += 1

    print(cnt)


main()
visited=set()
success=1
def dfs(graph, node):
  global b
  global visited
  if node not in visited:
    visited.add(node)
    for counter in range(len(graph[node-1][0])):
      if b[graph[node-1][0][counter]-1]==10000000000000000000:
        b[graph[node-1][0][counter]-1]=b[node-1]+graph[node-1][1][counter]
      else:
        if  b[graph[node-1][0][counter]-1]!=b[node-1]+graph[node-1][1][counter]:
          global success
          success=0
      dfs(graph, graph[node-1][0][counter])
n,m=map(int,input().split())
a=[]
b=[10000000000000000000]*n
for i in range(n):
  a.append([[],[]])
done=[0]*n
for i in range(m):
  l,r,d=map(int,input().split())
  a[l-1][0].append(r)
  a[l-1][1].append(d)
  a[r-1][0].append(l)
  a[r-1][1].append(-d)
current=[1]
for i in range(n):
  b[i]=0
  dfs(a,i+1)
if success==0:
  print('No')
else:
  print('Yes')

### FIXED CODE ###

visited=set()
success=1
import sys
sys.setrecursionlimit(1000000)
def dfs(graph, node):
  global visited
  global b
  global success
  if node not in visited:
    visited.add(node)
    for counter in range(len(graph[node-1][0])):
      if b[graph[node-1][0][counter]-1]==10000000000000000000:
        b[graph[node-1][0][counter]-1]=b[node-1]+graph[node-1][1][counter]
      else:
        if  b[graph[node-1][0][counter]-1]!=b[node-1]+graph[node-1][1][counter]:
          success=0
      dfs(graph, graph[node-1][0][counter])
      
n,m=map(int,input().split())
a=[]
b=[10000000000000000000]*n
for i in range(n):
  a.append([[],[]])
done=[0]*n
for i in range(m):
  l,r,d=map(int,input().split())
  a[l-1][0].append(r)
  a[l-1][1].append(d)
  a[r-1][0].append(l)
  a[r-1][1].append(-d)
current=[1]
for i in range(n):
  if i+1 in visited:
    continue
  b[i]=0
  dfs(a,i+1)
if success==0:
  print('No')
else:
  print('Yes')
N, K, S = map(int, input().split())
arr = [1 if S > N else S + 1] * N
for i in range(K):
    arr[i] = S
print(arr)

### FIXED CODE ###

W = int(input())
H = int(input())
N = int(input())
longer = max(W, H)
res = cur = 0
while cur < N:
    cur += longer
    res += 1
print(res)
# coding=utf-8
def counting_sort(input_list: list, upper: int) -> list:
    number = len(input_list)

    # noinspection PyUnusedLocal
    b = [0 for i in range(number+1)]
    # noinspection PyUnusedLocal
    counter_list = [0 for i in range(upper+1)]

    for j in input_list:
        counter_list[j] += 1

    for i in range(k+1):
        counter_list[i] += counter_list[i-1]

    for j in range(number):
        b[counter_list[input_list[j]]] = input_list[j]
        counter_list[input_list[j]] -= 1

    return b


if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))
    k = 100
    a = counting_sort(a, k)
    a.pop(0)

    print(' '.join(map(str, a)))

### FIXED CODE ###

# coding=utf-8
def counting_sort(input_list: list, upper: int) -> list:
    number = len(input_list)

    # noinspection PyUnusedLocal
    b = [0 for i in range(number+1)]
    # noinspection PyUnusedLocal
    counter_list = [0 for i in range(upper+1)]

    for j in input_list:
        counter_list[j] += 1

    for i in range(k+1):
        counter_list[i] += counter_list[i-1]

    for j in range(number):
        b[counter_list[input_list[j]]] = input_list[j]
        counter_list[input_list[j]] -= 1

    return b


if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))
    k = 2000000
    a = counting_sort(a, k)
    a.pop(0)

    print(' '.join(map(str, a)))
numbers = input().split()
if(numbers[0]*numbers[1] < numbers[2]):
  ans = numbers[0]*numbers[1]
else:
  ans = number[2]

print(ans)

### FIXED CODE ###

numbers = input().split()
if(int(numbers[0])*int(numbers[1]) < int(numbers[2])):
  ans = int(numbers[0])*int(numbers[1]) 
else:
  ans = int(numbers[2])
 
print(ans)
from bisect import bisect_left


def main():
    N = int(input())
    A = [int(x) for x in input().split()]
    tree = [list() for _ in range(N)]
    for _ in range(N-1):
        u, v = [int(x) for x in input().split()]
        u -= 1
        v -= 1
        tree[u].append(v)
        tree[v].append(u)

    ans = [1] * N

    # dfs
    def dfs(u, par, dp: list):
        if A[u] > dp[-1]:
            dp.append(A[u])
        else:
            dp[bisect_left(dp, A[u])] = A[u]
        ans[u] = max(ans[u], len(dp))
        for v in tree[u]:
            if v != par:
                dfs(v, u, dp)
                if dp:
                    val = dp.pop()
                    if val < A[u]:
                        dp.append(A[u])

    dfs(0, -1, [A[0]])

    for i in range(N):
        print(ans[i])



if __name__ == '__main__':
    import sys
    sys.setrecursionlimit(2*(10**5)+1)
    main()


### FIXED CODE ###

from bisect import bisect_left


def main():
    N = int(input())
    A = [int(x) for x in input().split()]
    tree = [list() for _ in range(N)]
    for _ in range(N-1):
        u, v = [int(x) for x in input().split()]
        u -= 1
        v -= 1
        tree[u].append(v)
        tree[v].append(u)

    ans = [1] * N

    # dfs
    def dfs(u, par):
        nonlocal ans
        nonlocal dp
        pos = bisect_left(dp, A[u])
        old = dp[pos]
        dp[pos] = A[u]

        ans[u] = bisect_left(dp, float("inf")) - 1

        for v in tree[u]:
            if v == par:
                continue
            dfs(v, u)

        dp[pos] = old

    dp = [float("inf")] * (N+1)
    dp[0] = float("-inf")
    dfs(0, -1)

    for i in range(N):
        print(ans[i])


if __name__ == '__main__':
    import sys
    sys.setrecursionlimit(10**6)
    main()
S = input()
K = int(input())

olds = S[0]
l = 1
c = 0
first = 1
for i in range(1,len(S)):

    if olds == S[i]:
        l += 1
    else:
        if first:
            firstL = l
            first = 0
        c += l//2
        l = 1
    olds = S[i]
    
    if i == len(S)-1:
        lastL = l
        c += l//2

if S[0] == S[-1] and firstL%2 == 1 and lastL%2 == 1:
    print((c+1)*K-1)
else:
    print(c*K)


### FIXED CODE ###

import sys

S = input()
K = int(input())

if len(S) == 1:
    print(K//2)
    sys.exit()
if len(S) == 2:
    if S[0] == S[1]:
        print(K)
    else:
        print('0')
    sys.exit()

olds = S[0]
l = 1
c = 0
first = 1
for i in range(1,len(S)):

    if olds == S[i]:
        l += 1
    else:
        if first:
            firstL = l
            first = 0
        c += l//2
        l = 1
    olds = S[i]
    
    if i == len(S)-1:
        if first:
            print(len(S)*K//2)
            sys.exit()
        lastL = l
        c += l//2

if S[0] == S[-1] and firstL%2 == 1 and lastL%2 == 1:
    print((c+1)*K-1)
else:
    print(c*K)
# -*- coding: utf-8 -*-
def main():
    A,B = int(input())
    if 1=< A < 10 and 1<= B < 10:
        print(A*B)
    else:
        print('-1')

if __name__ == '__main__':
    main()

### FIXED CODE ###

# -*- coding: utf-8 -*-
def main():
    A,B = map(int,input().split())
    if 1 <= A < 10 and 1<= B < 10:
        print(A*B)
    else:
        print('-1')

if __name__ == '__main__':
    main()
from collections import deque
n,m = map(int, input().split())


graph = [[] for _ in range(n+1)]
for i in range (m):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)

print(graph)

dist = [-1]*2 + [0 for i in range (n-1)]
dist[1] = 0
d = deque([1])
print(d)

while d:
    v = d.popleft()
    graph.remove(v)
    for i in graph[v]:
        if dist[i] == 0:
            dist[i] = v
            d.append(i)
            print(i ," " ,dist[i], d)
            

print("Yes")
ans = dist[2:]
print(*ans, sep="\n")

### FIXED CODE ###

from collections import deque
n,m = map(int, input().split())


graph = [[] for _ in range(n+1)]
for i in range (m):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)

#print(graph)

dist = [-1]*2 + [0 for i in range (n-1)]

d = deque([1])
#print(d)

while d:
    v = d.popleft()
    for i in graph[v]:
        if dist[i] == 0:
            dist[i] = v
            d.append(i)

print("Yes")
ans = dist[2:]
print(*ans, sep="\n")
N=int(input())
A=list(map(int,input().split()))
cnt=1
for i in range(N):
    cnt*=A[i]
pritn(cnt)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
A=sorted(A)
cnt=1
for i in range(N):
    cnt*=A[i]
    if cnt>10**18:
        cnt=-1
        break
print(cnt)
a, b, c = map(int, input().split())

if a < b:
	if a < c:
		x = a
		if b < c:
			y = b
			z = c
		else:
			y = c
			z = b
	else:
		x = c
		y = a
		z = b
elif a < c:
	 	x = b
	 	y = a
	 	z = c
elif b < c:
		x = b
		y = c
		x = a
else:
	x = c
	y = b
	z = a
	
print(x, y, z) 

### FIXED CODE ###

a, b, c = map(int, input().split())

if a < b:
	if a < c:
		x = a
		if b < c:
			y = b
			z = c
		else:
			y = c
			z = b
	else:
		x = c
		y = a
		z = b
elif a < c:
	 	x = b
	 	y = a
	 	z = c
elif b < c:
	x = b
	y = c
	z = a
else:
	x = c
	y = b
	z = a
	
print(x, y, z)
# -*- coding: utf-8 -*-

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    r = int(lines[0])

    return r


def solve(r):

    return r*r

def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()
	

### FIXED CODE ###

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

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    r = int(lines[0])

    return (r, )


def solve(r):

    return r*r

def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()
S = input().strip()
N = len(S)
K = int(input())

T = set()
for i in range(N):
    for j in range(i + 1, N + 1):
        T.add(S[i:j])
A = sorted(list(T))
print(A[K])

### FIXED CODE ###

S = input().strip()
N = len(S)
K = int(input()) - 1

T = set()
for i in range(N):
    for j in range(i + 1, min(N + 1, i + 6)):
        T.add(S[i:j])
A = sorted(list(T))
print(A[K])
a = int(input())

b = []

p = 0
pp = 0
ppp = 0

for i in range(a):
    b.append(list(map(int,input().split())))
b.sort(b,key=lambda x:-x[2])
if a == 1:
    print(b[0][0],b[0][1],b[0][2])
else:
    for i in range(0,101,-1):
        for j in range(0,101,-1):
            for k in range(a):
                if k == 0:
                 p = abs(b[k][0] - i) + abs(b[k][1]-j)+b[k][2]
            else:
                if max(0,p - abs(b[k][0]-i)- abs(b[k][1]-j)) != b[k][2]:
                    pp = 1
        if pp == 0:
            ppp = 1
            break
        else:
            pp = 0
        if ppp == 1:
            print(i,j,p)
            break



### FIXED CODE ###

a = int(input())

b = []

p = 0
pp = 0
ppp = 0

for i in range(a):
    b.append(list(map(int,input().split())))
b.sort(key=lambda x:-x[2])
for i in range(0,101):
    for j in range(0,101):
        for k in range(a):
            if k == 0:
                p = abs(b[k][0] - i) + abs(b[k][1]-j)+b[k][2]
            else:
                if max(0,p - abs(b[k][0]-i)- abs(b[k][1]-j)) != b[k][2]:
                    pp = 1
        if pp == 0:
            ppp = 1
            break
        else:
            pp = 0
    if ppp == 1:
        print(i,j,p)
        break
Num=input()
String=int(input())
Library=[['A',1],['B',2],['C',3],['D',4],['E',5],['F',6],['G',7],['H',8],['I',9],['J',10],['K',11],['L',12],['M',13],['N',14],['O',15],['P',16],['Q',17],['R',18],['S',19],['T',20],['U',21],['V',22],['W',23],['X',24],['Y',25],['Z',26]]
newstring=''
for i in String:
    for j in range(0,25):
        if i==Library[j][0]:
            oldstring=newstring
            newstring=oldstring+Library[(j+Num)%26][0]
print(newstring)

### FIXED CODE ###

Num=int(input())
String=input()
Library=[['A',1],['B',2],['C',3],['D',4],['E',5],['F',6],['G',7],['H',8],['I',9],['J',10],['K',11],['L',12],['M',13],['N',14],['O',15],['P',16],['Q',17],['R',18],['S',19],['T',20],['U',21],['V',22],['W',23],['X',24],['Y',25],['Z',26]]
newstring=''
for i in String:
    for j in range(0,26):
        if i==Library[j][0]:
            oldstring=newstring
            newstring=oldstring+Library[(j+Num)%26][0]
print(newstring)
a,b,c,d,e,f=map(int,input().split())
a=0
ans=[0,0]
for i in range(0,f+1,a*100):
  for j in range(0,f+1-i,b*100):
    for k in range(0,e*(i+j)//100+1,c):
      for l in range(0,e*(i+j)//100+1-k,d):
        if i+j+k+l>f:
          continue
        if a<(k+j)/(i+j):
          a=(k+j)/(i+j)
          ans=[i+j+k+l,k+l]
print(ans[0],ans[1])
        

### FIXED CODE ###

a,b,c,d,e,f=map(int,input().split())
aa=-1
ans=[0,0]
for i in range(0,f+1,a*100):
  for j in range(0,f+1-i,b*100):
    for k in range(0,int(e*(i+j)/100)+1,c):
      for l in range(0,int(e*(i+j)/100)+1-k,d):
        if i+j+k+l>f:
          continue
        if i+j>0 and aa<(k+l)/(i+j+k+l):
          aa=(k+l)/(i+j+k+l)
          ans=[i+j+k+l,k+l]
print(ans[0],ans[1])
inputA= int(input())
inputB =map(str,input().split())

print(inputB.count('ABC'))

### FIXED CODE ###

inputA= int(input())
inputB =input()

print(inputB.count('ABC'))