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

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)

H, W, M = map(int, input().split())
hw = [[int(i) for i in input().split()] for _ in range(M)]

hl = [0] * H
wl = [0] * W
mem = set()

for h, w in hw :
  hl[h - 1] += 1
  wl[w - 1] += 1
  mem.add((h - 1, w - 1))
  
mh = max(hl)
mw = max(wl)
hs = []
ws = []
for i, y in enumerate(hl) :
  if y == mh :
    hs.append((i, y))
for i, x in enumerate(wl) :
  if x == mw :
    ws.append((i, x))
    
ret = 0
for x, w in ws :
  for y, h in hs :
    if (y, x) in mem :
      ret = max(ret, w + h - 1)
    else :
      ret = max(ret, w + h)
    
print(ret)

### FIXED CODE ###

import sys
input = sys.stdin.readline

H, W, M = map(int, input().split())
hw = [[int(i) for i in input().split()] for _ in range(M)]

hl = [0] * H
wl = [0] * W
mem = set()

for h, w in hw :
  hl[h - 1] += 1
  wl[w - 1] += 1
  mem.add((h - 1, w - 1))
  
mh = max(hl)
mw = max(wl)

if mh == 0 :
  print(mw)
elif mw == 0 :
  print(mh)
else :
  hs = []
  ws = []
  for i, y in enumerate(hl) :
    if y == mh :
      hs.append((i, y))
  for i, x in enumerate(wl) :
    if x == mw :
      ws.append((i, x))


  ret = 0
  for x, w in ws :
    flag = False
    for y, h in hs :
      if (y, x) in mem :
        ret = max(ret, w + h - 1)
      else :
        ret = max(ret, w + h)
        flag = True
        break
    if flag :
      break
      
  print(ret)
### BUGGY CODE ###

th, tw = map(int, input().split())
t = [input().strip() for _ in range(th)]
ph, pw = map(int, input().split())
p = [input().strip() for _ in range(ph)]

for i in range(th - ph + 1):
    for j in range(tw - pw + 1):
        for k in range(ph):
            if t[i + k][j:j + pw] != p[k]:
                break
        else:
            print(i, j)

### FIXED CODE ###

base1 = 127
base2 = 1009
mask = (1 << 32) - 1


def calc_hash(f, r, c):
    global ph, pw, h
    tmp = [[0] * c for _ in range(r)]
    dr, dc = r - ph, c - pw

    t1 = 1
    for _ in range(pw):
        t1 = (t1 * base1) & mask
    for i in range(r):
        e = 0
        for j in range(pw):
            e = e * base1 + f[i][j]
        for j in range(dc):
            tmp[i][j] = e
            e = (e * base1 - t1 * f[i][j] + f[i][j + pw]) & mask
        tmp[i][dc] = e

    t2 = 1
    for _ in range(ph):
        t2 = (t2 * base2) & mask
    for j in range(dc + 1):
        e = 0
        for i in range(ph):
            e = e * base2 + tmp[i][j]
        for i in range(dr):
            h[i][j] = e
            e = (e * base2 - t2 * tmp[i][j] + tmp[i + ph][j]) & mask
        h[dr][j] = e


th, tw = map(int, input().split())
t = [[ord(c) for c in input().strip()] for _ in range(th)]
ph, pw = map(int, input().split())
p = [[ord(c) for c in input().strip()] for _ in range(ph)]

if th >= ph and tw >= pw:
    h = [[0] * tw for _ in range(th)]
    calc_hash(p, ph, pw)
    key = h[0][0] & mask
    calc_hash(t, th, tw)
    for i in range(th - ph + 1):
        for j in range(tw - pw + 1):
            if h[i][j] & mask == key:
                print(i, j)
### BUGGY CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
counter = 1
for i in range(k):
    counter *= a[i]
for i in range(k, n):
    after = counter // a[i-k] * a[i]
    if after > counter:
        print('Yes')
    else: 
        print('No')
    counter = after

### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
for i in range(0, n-k):
    if a[i] >= a[i+k]:
        print('No')
    else:
        print('Yes')
### BUGGY CODE ###

n=int(input())
lst=list(map(int,input().split()))
idou=[abs(lst[0])]
for i in range(1,n):
    idou.append(abs(lst[i]-lst[i-1]))
idou.append(abs(lst[-1]))

copy_idou=idou[:]
copy_idou[0],copy_idou[1]=0,abs(lst[1])
print(sum(copy_idou))

for i in range(1,n-1):
    copy_idou=idou[:]
    copy_idou[i],copy_idou[i+1]=0,(abs(lst[i+1]-lst[i-1]))
    print(sum(copy_idou))

copy_idou=idou[:]
copy_idou[-1],copy_idou[-2]=abs(lst[-2]),0
print(sum(copy_idou))

### FIXED CODE ###

n=int(input())
lst=list(map(int,input().split()))
idou=[abs(lst[0])]
for i in range(1,n):
    idou.append(abs(lst[i]-lst[i-1]))
idou.append(abs(lst[-1]))
kyori=sum(idou)


kyo=kyori-(idou[0]+idou[1])
kyo+=abs(lst[1])
print(kyo)

for i in range(1,n-1):
    kyo=kyori-(idou[i]+idou[i+1])
    kyo+=(abs(lst[i+1]-lst[i-1]))
    print(kyo)

kyo=kyori-(idou[-1]+idou[-2])
kyo+=abs(lst[-2])
print(kyo)
### BUGGY CODE ###

temp=input().split(" ")
n=int(temp[0])
k=int(temp[1])
k2=2*k
tileb=[[0 for i in range(k2*2)] for j in range(k2*2)]
for i in range(n):
    temp=input().split(" ")
    x=int(temp[0])
    y=int(temp[1])
    c=temp[2]
    tempx=x%(k2)
    if c=='B':  
        tempy=y%(k2)
        
    elif c=='W':  
        tempy=(y+k)%(k2)

    tileb[tempy][tempx]+=1
    tileb[tempy+k2][tempx]+=1
    tileb[tempy][tempx+k2]+=1
    tileb[tempy+k2][tempx+k2]+=1
        

#ruisekiwa=[[0 for i in range(k2)] for j in range(k2)]
# for x in range(0,k2):
#     ruisekiwa[0][x]=tileb[0][x]

ans=0
for y in range(0,k2*2):
    for x in range(1,k2*2):
        tileb[y][x]+=tileb[y][x-1]

for x in range(0,k2*2):
    for y in range(1,k2*2):
        tileb[y][x]+=tileb[y-1][x]

def nijiruisekiwa(x,y,k): #左下(x,y) 長さkの正方形領域の和
    global tileb
    if x==0 and y==0:     
        return tileb[y+k-1][x+k-1]
    if y==0:     
        return tileb[y+k-1][x+k-1]-tileb[y+k-1][x-1]
    if x==0:     
        return tileb[y+k-1][x+k-1]-tileb[y-1][x+k-1]
    else:     
        return tileb[y+k-1][x+k-1]-tileb[y+k-1][x-1]-tileb[y-1][x+k-1]+tileb[y-1][x-1]
for x in range(0,k2):
    for y in range(0,k2):
        temp=0
        a=nijiruisekiwa(x,y,k)
        b=nijiruisekiwa(x+k,y+k,k)

        temp=a+b
      #  print("temp="+str(temp))

        if temp>ans:
            # print(a)
            # print(b)
            # print("x={0}  y={1}  ".format(x,y))
            ans=temp
print(ans)


### FIXED CODE ###

temp=input().split(" ")
n=int(temp[0])
k=int(temp[1])
k2=2*k
tileb=[[0 for i in range(k2*2)] for j in range(k2*2)]
for i in range(n):
    temp=input().split(" ")
    x=int(temp[0])
    y=int(temp[1])
    c=temp[2]
    tempx=x%(k2)
    if c=='B':  
        tempy=y%(k2)
        
    elif c=='W':  
        tempy=(y+k)%(k2)

    tileb[tempy][tempx]+=1
    tileb[tempy+k2][tempx]+=1
    tileb[tempy][tempx+k2]+=1
    tileb[tempy+k2][tempx+k2]+=1
        
ans=0
for y in range(0,k2*2):
    for x in range(1,k2*2):
        tileb[y][x]+=tileb[y][x-1]

for x in range(0,k2*2):
    for y in range(1,k2*2):
        tileb[y][x]+=tileb[y-1][x]

def nijiruisekiwa(x,y,k): #左下(x,y) 長さkの正方形領域の和
    global tileb
    if x!=0 and y!=0:
        return tileb[y+k-1][x+k-1]-tileb[y+k-1][x-1]-tileb[y-1][x+k-1]+tileb[y-1][x-1]
    
    if x==0 and y==0:     
        return tileb[y+k-1][x+k-1]
    if y==0:     
        return tileb[y+k-1][x+k-1]-tileb[y+k-1][x-1]
    if x==0:     
        return tileb[y+k-1][x+k-1]-tileb[y-1][x+k-1]
    
for x in range(0,k2):
    for y in range(0,k2):
        temp=0
        a=nijiruisekiwa(x,y,k)
        b=nijiruisekiwa(x+k,y+k,k)

        temp=a+b
      #  print("temp="+str(temp))

        if temp>ans:
            # print(a)
            # print(b)
            # print("x={0}  y={1}  ".format(x,y))
            ans=temp
print(ans)
### BUGGY CODE ###

n = int(input())
S = input()

ans = set()
for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            ans.add(100*int(S[i])+10*int(S[j])+int(S[k]))

print(len(ans))

### FIXED CODE ###

n = int(input())
S = input()
l = len(S)

S += 'eeee'

cnt = 0
for i in range(10):
    for j in range(10):
        for k in range(10):
            # tmp = str(i)+str(j)+str(k)
            m = 0
            while S[m] != str(i):
                m += 1
                if m >= l:
                    break
            m += 1
            while S[m] != str(j):
                m += 1
                if m >= l:
                    break
            m += 1
            while S[m] != str(k):
                m += 1
                if m >= l:
                    break
            if m < l:
                cnt += 1

print(cnt)
### BUGGY CODE ###

#!/usr/bin/env python3
import math

def is_prime(x):
    if x < 2: return False
    if x == 2 or x == 3 or x == 5: return True
    if x % 2 == 0 or x % 3 == 0 or x % 5 == 0: return False

    sx = math.sqrt(x)
    prime = 7
    step = 4
    while prime <= sx:
        if x % prime == 0: return False

        prime += step
        step = 6 - step

    return True

def main():
    Q = int(input())
    l = []
    r = []
    for i in range(Q):
        sa = input().split(' ')
        l.append(int(sa[0]))
        r.append(int(sa[1]))

#    r_max = 100000
#    primes = [True for i in range(r_max)]
#    primes[0] = False
#    primes[1] = False
#    i = 2
#    max_i = int(math.sqrt(r_max))
#    while i <= max_i:
#        for j in range(i * i, r_max, i):
#            primes[j] = False
#        while i <= max_i:
#            i += 1
#            if primes[i]:
#                break

    for i in range(Q):
        c = 0
        for j in range(l[i], r[i] + 1, 2):
            if is_prime(j) and is_prime(int((j + 1) / 2)):
                c += 1
        print(c)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import math

def main():
    Q = int(input())
    l = []
    r = []
    for i in range(Q):
        na = list(map(int, input().split()))
        l.append(na[0])
        r.append(na[1])

    r_max = 100000
    primes = [True for i in range(r_max)]
    like_numbers = [0 for i in range(r_max)]

    primes[0] = primes[1] = False
    max_i = int(math.sqrt(r_max))
    i = 2
    while i <= max_i:
        primes[i] = True
        for j in range(i * i, r_max, i):
            primes[j] = False
        while i <= max_i:
            i += 1
            if primes[i]:
                break

    for i in range(3, r_max, 2):
        if primes[i] and primes[int((i + 1) / 2)]:
            like_numbers[i] = 1

    c = 0
    for i in range(3, r_max, 2):
        if like_numbers[i]:
            c += 1
        like_numbers[i] = c


    for i in range(Q):
        if l[i] == 1:
            print(like_numbers[r[i]])
        else:
            print(like_numbers[r[i]] - like_numbers[l[i] - 2])

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

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

N, Q = map(int, input().split())
link = [[] for _ in range(N)]
a = [0] * (N-1)
b = [0] * (N-1)
for i in range(N-1):
    a[i], b[i] = map(int, input().split())

cost = [0] * N
for i in range(Q):
    p, x = map(int, input().split())
    cost[p-1] += x

for i in range(N-1):
    link[a[i]-1].append([b[i]-1, cost[i]])
    link[b[i]-1].append([a[i]-1, cost[i]])

def dfs(v, c, p):
    for nv in link[v]:
        if nv[0] == p:
            continue
        cost[nv[0]] = c + cost[nv[0]]
        dfs(nv[0], cost[nv[0]], v)
    return

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

print(*cost)


### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

def dfs(v, p):
    for u in link[v]:
        if u == p:
            continue
        ans[u] += ans[v]
        dfs(u, v)

N, Q = map(int, input().split())
link = [[] for _ in range(N)]
for i in range(N-1):
    a, b = map(int, input().split())
    link[a-1].append(b-1)
    link[b-1].append(a-1)

ans = [0] * N
for i in range(Q):
    p, x = map(int, input().split())
    ans[p-1] += x

dfs(0, -1)

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

from collections import deque
import copy

digtmp = [[0, 1], [1, 0], [0, -1], [-1, 0]]

def bfs(maze, s, g):
    que = deque([s])
    maze[s[0]][s[1]] = 0
    for _ in range(pow(10, 3)):
        fr = que.popleft()
        for d in digtmp:
            to = [fr[0] + d[0], fr[1] + d[1]]
            if maze[to[0]][to[1]] == '.':
                maze[to[0]][to[1]] = maze[fr[0]][fr[1]] + 1
                que.append(to)
        if maze[g[0]][g[1]] != '.':
            break
        if len(que) == 0:
            break
    ans = maze[g[0]][g[1]]
    return ans

def main():
    H, W = map(int, input().split())
    grid = []; road = []
    grid.append(['#']*(W+2))
    for i in range(H):
        tmp = list(input())
        for j in range(W):
            if tmp[j] == '.':
                road.append([i+1, j+1])
        grid.append(['#'] + tmp + ['#'])
    grid.append(['#']*(W+2))
    
    ans = 1
    for i in range(len(road)):
        for j in range(i+1, len(road)):
            maze = copy.deepcopy(grid)
            ans = max(ans, bfs(maze, road[i], road[j]))
    print(ans)

if __name__ == "__main__":
    main()


### FIXED CODE ###

from collections import deque
import copy

digtmp = [[0, 1], [1, 0], [0, -1], [-1, 0]]

def bfs(maze, s):
    que = deque([s])
    maze[s[0]][s[1]] = 0
    ans = 0
    for _ in range(pow(10, 3)):
        fr = que.popleft()
        for d in digtmp:
            to = [fr[0] + d[0], fr[1] + d[1]]
            if maze[to[0]][to[1]] == '.':
                nxt = maze[fr[0]][fr[1]] + 1
                maze[to[0]][to[1]] = nxt
                ans = max(ans, nxt)
                que.append(to)
        if len(que) == 0:
            break
    return ans

def main():
    H, W = map(int, input().split())
    grid = []; road = []
    grid.append(['#']*(W+2))
    for i in range(H):
        tmp = list(input())
        for j in range(W):
            if tmp[j] == '.':
                road.append([i+1, j+1])
        grid.append(['#'] + tmp + ['#'])
    grid.append(['#']*(W+2))
    
    ans = 1
    for r in road:
        maze = copy.deepcopy(grid)
        ans = max(ans, bfs(maze, r))
    print(ans)

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

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

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

answer = max(C)
for i in range(N):
  pos = P[i] - 1
  score = C[pos]
  score_list = [score]
  step = 1
  while pos!=i and step<K:
    pos = P[pos] - 1
    score += C[pos]
    score_list.append(score)
    step += 1
  if score_list[-1]>0 and step<K:
    loop = K//step
    amari = K%step
    score_max_tmp = 0
    for j in range(step):
      if j<amari:
        score_max_tmp = max(score_max_tmp, score_list[-1]+score_list[j])
      else:
        score_max_tmp = max(score_max_tmp, score_list[j])
    score_max = score_max_tmp+score_list[-1]*(loop-1)
  else:
    score_max = max(score_list)
  answer = max(answer,score_max)

print(answer)


### FIXED CODE ###

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

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

answer = max(C)
for i in range(N):
  pos = P[i] - 1
  score = C[pos]
  score_list = [score]
  step = 1
  while pos!=i and step<K:
    pos = P[pos] - 1
    score += C[pos]
    score_list.append(score)
    step += 1
  score_max = max(score_list)
  if score_list[-1]>0 and step<K:
    loop = K//step
    amari = K%step
    for j in range(step):
      if j<amari:
        score_max = max(score_max, score_list[-1]*loop+score_list[j])
      else:
        score_max = max(score_max, score_list[-1]*(loop-1)+score_list[j])
  answer = max(answer,score_max)

print(answer)
### BUGGY CODE ###

n,a,b,c,d,e = int(input()),int(input()),int(input()),int(input()),int(input()),int(input())
p = [n,0,0,0,0,0]
def time(q):
    A = min(q[0],a)
    B = min(q[1],b)
    C = min(q[2],c)
    D = min(q[3],d)
    E = min(q[4],e)
    q[0] -= A
    q[1] += A-B
    q[2] += B-C
    q[3] += C-D
    q[4] += D-E
    q[5] += E
count = 0
while p[5] < n:
    time(p)
    count += 1
print(count)

### FIXED CODE ###

import math
N,A,B,C,D,E = int(input()),int(input()),int(input()),int(input()),int(input()),int(input())
print(math.ceil(N/min(A,B,C,D,E)+4))
### BUGGY CODE ###

n,m = map(int,input().split())
from collections import deque
a = []
for _ in range(n):
    a.append(list(input()))

count = 0
for x in a:
    count += x.count("#")
#print(count)

b = [[-1 for i in range(m)] for i in range(n)]
#print(a)

x = [0, 0, -1, 1]
y = [-1, 1, 0, 0]
now = [0,0]
queue = deque([[0,0]])
b[0][0] = 1
while queue:
    now = queue.popleft()
    if now == [n-1,m-1]:
        print(n * m - (b[n-1][m-1] + count))
        exit()
    a[now[0]][now[1]] = "#"
    for i in range(4):
        if 0 <= now[0] + y[i] < n and 0 <= now[1] + x[i] < m:
            if a[now[0]+y[i]][now[1]+x[i]] == '.':
                queue.append([now[0]+y[i],now[1]+x[i]])
                b[now[0]+y[i]][now[1]+x[i]] = b[now[0]][now[1]] + 1

print(-1)



### FIXED CODE ###

n,m = map(int,input().split())
from collections import deque
a = []
for _ in range(n):
    a.append(list(input()))

count = 0
for x in a:
    count += x.count("#")
#print(count)

b = [[-1 for i in range(m)] for i in range(n)]
#print(a)

x = [0, 0, -1, 1]
y = [-1, 1, 0, 0]
queue = deque([[0,0]])
b[0][0] = 1
while queue:
    now = queue.popleft()
    if now == [n-1,m-1]:
        print(n * m - (b[n-1][m-1] + count))
        exit()
    a[now[0]][now[1]] = "#"
    for i in range(4):
        if 0 <= now[0] + y[i] < n and 0 <= now[1] + x[i] < m and b[now[0]+y[i]][now[1]+x[i]] == -1:
            if a[now[0]+y[i]][now[1]+x[i]] == '.':
                queue.append([now[0]+y[i],now[1]+x[i]])
                b[now[0]+y[i]][now[1]+x[i]] = b[now[0]][now[1]] + 1

print(-1)
### BUGGY CODE ###

X = int(input())
for A in range(-2500, 2500):
    for B in range(-2500, 2500):
        if A**5 - B**5 == X:
            print(A, B)
            break
    else:
        continue
    break

### FIXED CODE ###

X = int(input())
for A in range(-200, 200):
    for B in range(-200, 200):
        if A**5 - B**5 == X:
            print(A, B)
            break
    else:
        continue
    break
### BUGGY CODE ###

def factorize(n):
    p = n
    while True:
        if p % 2 == 0:
            p //= 2
            yield 2
        else:
            break

    r = 3
    while p >= r:
        if p % r == 0:
            p //= r
            yield r
        else:
            r += 2

n = int(input())
l = factorize(n)

print(str(n)+":",*list(l))

### FIXED CODE ###

import math

def factorize(p):
    l = []
    while p % 2 == 0:
        p //= 2
        l.append(2)

    r = 3
    while r < int(math.sqrt(p)+1):
        if p % r == 0:
            p //= r
            l.append(r)
        else:
            r += 2

    if p != 1:
        l.append(p)

    return l

n = int(input())
l = factorize(n)

print(str(n)+":",*l)
### BUGGY CODE ###

# Bellman-Ford

def shortest_path(s,n,es):
    # s : 始点、　n : 頂点数、 w : 辺の数、 es[i] : 辺の始点、辺の終点、辺のコスト
    # dはsからの最短距離を表す(最初は始点以外はINFに設定しておく)
    d = [float('inf')] * n
    d[s] = 0

    # 無限ループ(速さを求めるならn-1回for文を回す)
    while True:
        # 無限ループの終了条件は1度も最短距離が更新されなかったとき
        update = False
        # 全ての辺に対して最短距離を緩和していく
        for p,q,r in es:
            # 点p→qに対して最短距離を更新する
            if d[p] != float('inf') and d[q] > d[p] + r:
                d[q] = d[p] + r
                update = True
        if not update:
            break
    return d


# n,w = map(int, input().split())
n = int(input())
es = []

for _ in range(n-1):
    x,y,z = map(int ,input().split())
    es.append([x-1,y-1,z])
    es.append([y-1,x-1,z])

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

QQ = []
for _ in range(q):
    x, y = map(int, input().split())
    QQ.append([x-1, y-1])

d_list = shortest_path(k-1, n, es)

for i, j in QQ:
    print(d_list[i] + d_list[j])


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)


def dfs(start, dist, distance_list, explored):
    for node, cost in tree[start]:
        if explored[node] is False:
            explored[node] = True
            distance_list[node] = dist + cost
            dfs(node, distance_list[node], distance_list, explored)
    return distance_list


n = int(input())
tree = [[] for _ in range(n)]
distance = [float('inf') for _ in range(n)]

for _ in range(n-1):
    a,b,c = map(int, input().split())
    a -= 1
    b -= 1
    tree[a].append((b, c))
    tree[b].append((a, c))

q, k = map(int, input().split())
k -= 1
query = []
distance[k] = 0

for _ in range(q):
    x, y = map(int, input().split())
    query.append((x-1, y-1))

XX = [False for _ in range(n)]
XX[k] = True

X = dfs(k, 0, distance, explored=XX)

for i, j in query:
    print(X[i] + X[j])
### BUGGY CODE ###

H = int(input())

def func(h):
    if h == 1:
        return 1
    else:
        return func(h // 2) + func(h // 2) + 1

r = func(H)
print(r)

### FIXED CODE ###

H = int(input())

def func(h):
    if h == 1:
        return 1
    else:
        return func(h // 2) * 2 + 1

r = func(H)
print(r)
### BUGGY CODE ###

n = int(input())
A = sorted(map(int, input().split()))

B = [0 for _ in range(n)]
for i in range(n):
  c = 0
  if B[i] == 1:
    continue
  if i < n-1 and A[i] == A[i+1]:
    B[i] = 1
    B[i+1] = 1
  while(A[i]*c <= A[n-1]):
    c += 1
    for j in range(n)[i+1:]:
      if B[j] == 1 or A[i]*c > A[j]:
        continue
      if A[j] == A[i]*c:
        B[j] = 1
print(n-sum(B))

### FIXED CODE ###

from collections import Counter
n = int(input())
A = sorted(map(int, input().split()))

c = Counter(A)

yes_or_no = [True for i in range(A[n-1]+1)]

for a in A:
  t = a*2
  while t <= A[n-1]:
    yes_or_no[t] = False
    t += a
ans = 0
for a in A:
  if c[a] == 1 and yes_or_no[a] == True:
    ans += 1
print(ans)
### BUGGY CODE ###

N = int(input())

for n in range(1, N+1):
  cnt = 0
  for x in range(1, 101):
    for y in range(1, 101):
      for z in range(1, 101):
        if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x == n:
          cnt += 1
  print(cnt)


### FIXED CODE ###

# ans

N = int(input())

ans = [0] * (N + 1)
for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      n = x * x + y * y + z * z + x * y + y * z + z * x
      if n <= N:
        ans[n] += 1

for i in range(1, len(ans)):
  print(ans[i])
### BUGGY CODE ###

d = input()
a = int(input())
p = []
k = len(d)
for i in range(k):
  for j in range(k-i+1):
    p.append(d[i:i+j])
    
x = list(set(p))
x.sort()
del x[0]

print(x[a-1])

### FIXED CODE ###

d = input()
a = int(input())
p = []
k = len(d)
for i in range(k):
  for j in range(min({6,k-i+1})):
    p.append(d[i:i+j])
    
x = list(set(p))
x.sort()
del x[0]
 
print(x[a-1])
### BUGGY CODE ###

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

items = [list(map(int, input().split())) for _ in range(N)]

d = {(W, 0)}

for w, v in items:
    tmp = set()
    for rw, rv in d:
        if rw >= w:
            tmp.add((rw-w, rv+v))
    d |= tmp

d = {elm[1] for elm in d}

print(max(d))

### FIXED CODE ###

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

from collections import defaultdict

dp = defaultdict(int)

dp[0] = 0

for _ in range(N):
    w, v = map(int, input().split())
    for k, val in list(dp.items()):
        if k+w <= W:
            dp[k+w] = max(dp[k+w], val+v)



print(max(dp.values()))
### BUGGY CODE ###

x, y, a, b, c = map(int, input().split())
p = [int(i) for i in input().split()]
q = [int(i) for i in input().split()]
r = [int(i) for i in input().split()]

p = list(reversed(sorted(p)))
q = list(reversed(sorted(q)))
r = list(reversed(sorted(r)))
p_cum = [0]
q_cum = [0]
r_cum = [0]
for i in range(a):
    p_cum.append(p_cum[i] + p[i])
for i in range(b):
    q_cum.append(q_cum[i] + q[i])
for i in range(c):
    r_cum.append(r_cum[i] + r[i])
ans = 0
for i in range(0, min(c, x) + 1):
    for j in range(0, min(c - i, y) + 1):
        ans = max(ans, p_cum[x - i] + q_cum[y - j] + r_cum[i + j])
print(ans)

### FIXED CODE ###

x, y, a, b, c = map(int, input().split())
p = [int(i) for i in input().split()]
q = [int(i) for i in input().split()]
r = [int(i) for i in input().split()]

p = list(reversed(sorted(p)))
q = list(reversed(sorted(q)))
r = list(reversed(sorted(r)))
apple = p[:x] + q[:y] + r
apple = list(reversed(sorted(apple)))
print(sum(apple[:x+y]))