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

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

b = sorted(set(x for x in a if 2 <= a.count(x)))
if b:
    maxb = b[-1]
    if 4 <= a.count(maxb):
        print(maxb ** 2)
    elif 2 <= len(b):
        print(maxb * b[-2])
    else:
        print(0)
else:
    print(0)

### FIXED CODE ###

from collections import Counter as C

_ = input()
a = C(map(int, input().split()))

b = []
for k, v in a.items():
    b.extend([k] * (v // 2))
else:
    if 2 <= len(b):
        b.sort()
        print(b[-1] * b[-2])
    else:
        print(0)
### BUGGY CODE ###

p = 10**9+7
def pow(x,m):
    if m==0:
        return 1
    if m==1:
        return x%13
    if m%2==0:
        return (pow(x,m//2)**2)%13
    else:
        return (x*(pow(x,(m-1)//2)**2)%13)%13
S = input().strip()
n = len(S)
A = [0 for _ in range(n)]
for i in range(n):
    A[i] = pow(10,i)
dp = [[0 for _ in range(13)] for _ in range(n+1)]
dp[0][0] = 1
for i in range(n):
    for j in range(13):
        if S[i]!="?":
            a = int(S[i])
            b = (a*A[n-1-i])%13
            dp[i+1][j] = dp[i][(j-b)%13]
        else:
            for k in range(10):
                b = (k*A[n-1-i])%13
                dp[i+1][j] = (dp[i+1][j]+dp[i][(j-b)%13])%p
print(dp[n][5])

### FIXED CODE ###

p = 10**9+7
S = input().strip()
n = len(S)
dp = [[0 for _ in range(13)] for _ in range(n+1)]
dp[0][0] = 1
for i in range(n):
    for j in range(13):
        if S[i]!="?":
            dp[i+1][(10*j+int(S[i]))%13] = dp[i][j]
        else:
            for k in range(10):
                dp[i+1][(10*j+k)%13] = (dp[i+1][(10*j+k)%13]+dp[i][j])%p
print(dp[n][5])
### BUGGY CODE ###

k,s=[int(i) for i in input().split()]
ans=0
chk=set([])
for i in range(k+1):
    for j in range(i,k+1):
        tmp=s-i-j
        x=[i,j,tmp]
        x.sort()
        x=tuple(x)
        if 0<=tmp<=k and x not in chk:
            chk.add(x)
            if i==j==tmp:
                ans+=1
            elif i==j or i==tmp or j==tmp:
                ans+=3
            else:
                ans+=6
print(ans)

### FIXED CODE ###

k,s=[int(i) for i in input().split()]
ans=0
chk=set([])
for i in range(k+1):
    for j in range(i,k+1):
        tmp=s-i-j
        if 0<=tmp<=k and i<=j<=tmp:
            if i==j==tmp:
                ans+=1
            elif i==j or i==tmp or j==tmp:
                ans+=3
            else:
                ans+=6
print(ans)
### BUGGY CODE ###

n, k = map(int, input().split())
h = sorted([int(input()) for i in range(n)])
ans = float("inf")
for i in range(n - k + 1):
    use = h[i:i + k]
    ans = min(ans, use[-1] - use[0])
print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
h = sorted([int(input()) for i in range(n)])
ans = float("inf")
for i in range(n - k + 1):
    ans = min(ans, h[i + k - 1] - h[i])
print(ans)
### BUGGY CODE ###

from heapq import heapify, heappop, heappush


def solve(n, aaa, bbb):
    q = [(-b, i) for i, b in enumerate(bbb) if b != aaa[i]]
    heapify(q)
    ans = 0
    while q:
        b, i = heappop(q)
        b = -b
        b -= bbb[(i - 1) % n] + bbb[(i + 1) % n]
        if b <= 0:
            return -1
        bbb[i] = b
        ans += 1
        if b != aaa[i]:
            heappush(q, (-b, i))
    return ans


n = int(input())
aaa = list(map(int, input().split()))
bbb = list(map(int, input().split()))
print(solve(n, aaa, bbb))


### FIXED CODE ###

from heapq import heapify, heappop, heappush


def solve(n, aaa, bbb):
    q = [(-b, i) for i, b in enumerate(bbb) if b != aaa[i]]
    heapify(q)
    ans = 0
    while q:
        b, i = heappop(q)
        b = -b - aaa[i]
        d, b = divmod(b, bbb[(i - 1) % n] + bbb[(i + 1) % n])
        if d == 0:
            return -1
        b += aaa[i]
        bbb[i] = b
        ans += d
        if b != aaa[i]:
            heappush(q, (-b, i))
    return ans


n = int(input())
aaa = list(map(int, input().split()))
bbb = list(map(int, input().split()))
print(solve(n, aaa, bbb))
### BUGGY CODE ###

def update():
    cost = list(map(abs, candles))
    min_cost_index = cost.index(min(cost))
    start_index = max(0, min_cost_index - K)
    end_index = min(N, min_cost_index + K)
    new_candles = candles[start_index: end_index]
    return new_candles

def compute_cost(point_candles):
    if(point_candles[0] * point_candles[-1] >= 0):
        return max(abs(point_candles[0]), abs(point_candles[-1]))
    else:
        return point_candles[-1] - point_candles[0] + min(abs(point_candles[0]), abs(point_candles[-1])) 

N, K = list(map(int, input().strip().split(" ")))
candles = list(map(int, input().strip().split(" ")))



candles = update()

N = len(candles)
min_cost = None
patterns = N - K + 1


for start_index in range(patterns):
    cost = compute_cost(candles[start_index:start_index + K])
    if(min_cost == None or min_cost > cost):
        min_cost = cost
print(min_cost)

### FIXED CODE ###

N, K = list(map(int, input().strip().split(" ")))
candles = input().strip()
min_cost_index = candles.count("-")
candles = list(map(int, candles.split(" ")))

def update():
    start_index = max(0, min_cost_index - K - 1)
    end_index = min(N, min_cost_index + K + 1)
    new_candles = candles[start_index: end_index]
    return new_candles

def compute_cost(start_index):
    start_point = candles[start_index]
    end_point = candles[start_index + K - 1]
    if(start_point * end_point >= 0):
        return max(abs(start_point), abs(end_point))
    else:
        return end_point - start_point + min(-start_point, end_point) 

candles = update()

N = len(candles)
min_cost = compute_cost(0)
patterns = N - K + 1

for start_index in range(patterns):
    cost = compute_cost(start_index)
    if(min_cost > cost):
        min_cost = cost
print(min_cost)
### BUGGY CODE ###

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




### FIXED CODE ###

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

def comb(n,k):
    nCk = 1
    MOD = 10**9+7
    # X
    for i in range(n-k+1, n+1):
        nCk *= i
        nCk %= MOD

    # Y
    for i in range(1,k+1):
        nCk *= pow(i,MOD-2,MOD)
        nCk %= MOD
    return nCk

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

cnt = [0]*(n+1)
ans = 0

for i in range(n):
    cnt[a[i]] += 1

for k in range(n):
    cnt[a[k]] -= 1
    ans = 0
    for j in range(1, n+1):
        if cnt[j] >= 2:
            ans += comb(cnt[j], 2)
    print(ans)
    cnt[a[k]] += 1

### FIXED CODE ###

def nC2(n):
    return n*(n-1)//2

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

cnt = [0]*(n+1)
total = 0
ans = 0

for i in range(n):
    cnt[a[i]] += 1

for i in range(1, n+1):
    total += nC2(cnt[i])

for i in range(n):
    print(total - nC2(cnt[a[i]]) + nC2(cnt[a[i]] - 1))
### BUGGY CODE ###

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

INF = float('inf')
dp = [INF for j in range(2**n)]

dp[0] = 0

for i in range(m):
    a, b = map(int, input().split())
    c = map(int, input().split())

    k = 0
    for ci in c:
        ci -= 1
        k |= (1 << ci)
    for j in range(2**n):
        l = k | j
        dp[l] = min(dp[l], dp[j] + a)

if dp[2**n-1] == INF:
    print(-1)
else:
    print(dp[2**n-1])


### FIXED CODE ###

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

INF = float('inf')
dp = [INF for j in range(2**n)]

dp[0] = 0

for i in range(m):
    a, b = map(int, input().split())
    c = map(int, input().split())

    k = 0
    for ci in c:
        ci -= 1
        k |= (1 << ci)
    for j in range(2**n):
        l = k | j
        dp[l] = min(dp[l], dp[j] + a)

if dp[2**n-1] == INF:
    print(-1)
else:
    print(dp[2**n-1])
### BUGGY CODE ###

# -*- coding: utf-8 -*-
from collections import deque

H,W = list(map(int, input().rstrip().split()))
A_list = [list(input().rstrip()) for i in range(H)]
#-----

def check(matrix):
    # queue = [ ( (row, column),step ) ]
    # deque = [ ( (int, int   ),int ) ]
    queue = deque()
    
    for i in range(len(matrix)):
        for j in range(len(matrix[i])):
            if matrix[i][j] == "#":
                queue.append(  ( (i, j), 0 )  )
    
    delta = [(1,0),(-1,0),(0,1),(0,-1)]
    max_step = 0
    
    while queue:
        (r,c),step = queue.popleft()
        
        for d in delta:
            next_r = r + d[0]
            next_c = c + d[1]
            
            if (0 <= next_r < H) and (0 <= next_c < W) and \
               matrix[next_r][next_c] == ".":
            
                matrix[next_r][next_c] = "#"
                queue.append( ( (next_r, next_c), step+1 ) )
                max_step = max(max_step, step+1)


    return max_step
#-----

ans = check(A_list)
print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-
from collections import deque

H,W = list(map(int, input().rstrip().split()))
A_list = [list(input().rstrip()) for i in range(H)]
#-----

def check(matrix):
    for i in range(len(matrix)):
        matrix[i] = ["#"] + matrix[i][:] + ["#"]
    
    matrix = [["#"]*(W+2)] + matrix[:] + [["#"]*(W+2)]
    
    
    # queue = [ (row, column) ]
    # deque = [ (int, int   ) ]
    queue = deque()
    
    for i in range(1,H+1):
        for j in range(1, W+1):
            if matrix[i][j] == "#":
                queue.append( (i, j) )
    
    
    delta = [(1,0),(-1,0),(0,1),(0,-1)]
    step = -1
    
    while queue:
        step += 1
        
        for _ in range(len(queue)):
            r,c = queue.popleft()
            
            for d in delta:
                next_r = r + d[0]
                next_c = c + d[1]
                
                if matrix[next_r][next_c] == ".":
                    matrix[next_r][next_c] = "#"
                    queue.append( (next_r, next_c) )


    return step

#-----

ans = check(A_list)
print(ans)
### BUGGY CODE ###

N, P = map(int, input().split())
ans = 1
def main(n, p):
  global ans
  for i in range(2, int(p**(2/n)+1)):
    if p % (i**n) == 0:
      ans *= i
      return main(n, p//(i**n))
  return ans

print(main(N, P))

### FIXED CODE ###

N, P = map(int, input().split())
ans = 1
def main(n, p):
  if n == 1:
    return P
  global ans
  for i in range(2, int(p**(2/n))):
    t = i**n
    if p % t == 0:
      ans *= i
      return main(n, p//t)
  return ans

print(main(N, P))
### BUGGY CODE ###

from bisect import insort_left

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

for i in range(M):
  a = A.pop(N-1)  
  insort_left(A, a/2)
  
print(sum(list(map(int, A))))  

### FIXED CODE ###

from heapq import heappush, heappop, heapify

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

  if N == 1: A[0] = A[0] // 2 ** M
  else:
    for i in range(N): A[i] *= -1

    heapify(A)

    for i in range(M):
      a = heappop(A)
      heappush(A, -(-a//2))

  print(-sum(A))  
  
if __name__ == '__main__':
  main()
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
cnt = 0
for i in range(N):
    divide_flag = 0
    for j in range(N):
        if i == j:
            continue
        if A[i] % A[j] == 0:
            divide_flag = 1
            break
    if divide_flag == 0:
        cnt += 1
print(cnt)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
cnt = 0
max = int(10e5+1)
l = [0] * (max+1)
for n in A:
    if l[n] != 0:
        l[n] = 2
        continue
    for j in range(n, max+1, n):
        l[j] += 1
for n in A:
    if l[n] == 1:
        cnt += 1
print(cnt)
### BUGGY CODE ###

import numpy as np

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

x = np.array(x)

for i in range(0,n):
    print(int(np.median(np.r_[x[:i],x[i+1:]])))
   # print(x[:i])
   # print(x[i+1:])

### FIXED CODE ###

import numpy as np

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

x = np.array(x)

y = np.sort(x)

left = y[n//2 - 1]
right = y[n//2 ]

for i in range(n):
    if x[i] <= left:
        print(right)
    else:
        print(left)
### BUGGY CODE ###

import re
import copy
s=input()
sr,ss=copy.deepcopy(s),""
while ss!=sr:
    sr,ss=ss,re.sub("01|10","",ss if sr!=s else s)
print(len(s)-len(ss))


### FIXED CODE ###

s=input();print(min(s.count("1"),s.count("0"))*2)
### BUGGY CODE ###

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

w = []
v = []
for _ in range(N):
    wv = list(map(int, input().split()))
    w.append(wv[0])
    v.append(wv[1])

dp = [[0, 0]]
for i in range(1, W+1):
    max_t = 0
    flag = 0
    for j in range(N):
        if w[j] > i or dp[i-w[j]][1] & (1 << j):
            continue
        if max_t < dp[i-w[j]][0] + v[j]:
            max_t = dp[i-w[j]][0] + v[j]
            flag = dp[i-w[j]][1] | (1 << j)
    dp += [[max_t, flag]]
print(dp[W][0])


### FIXED CODE ###

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

w = []
v = []
for _ in range(N):
    wv = list(map(int, input().split()))
    w.append(wv[0])
    v.append(wv[1])

dp = [[0, 0]]
for i in range(1, W+1):
    max_t = dp[i-1][0]
    flag = dp[i-1][1]
    for j in range(N):
        if w[j] > i or dp[i-w[j]][1] & (1 << j):
            continue
        if max_t < dp[i-w[j]][0] + v[j]:
            max_t = dp[i-w[j]][0] + v[j]
            flag = dp[i-w[j]][1] | (1 << j)
    dp += [[max_t, flag]]
print(dp[W][0])
### BUGGY CODE ###

N = int(input())
A = []
for _ in range(N):
    a = int(input())
    A.append(a - 1)
Flags = [False] * N
Flags[0] = True
now = 0
cnt = 0
while now != 1:
    cnt += 1
    next_node = A[now]
    if Flags[next_node]:
        print("-1")
        exit()
    now = next_node
print(cnt)


### FIXED CODE ###

N = int(input())
A = []
for _ in range(N):
    a = int(input())
    A.append(a - 1)
Flags = [False] * N
Flags[0] = True
now = 0
cnt = 0
for _ in range(N):
    cnt += 1
    next_node = A[now]
    if next_node == 1:
        break
    if Flags[next_node]:
        print("-1")
        exit()
    Flags[next_node] = True
    now = next_node
print(cnt)
### BUGGY CODE ###

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

import numpy as np

N = int(input())
S = []

a_ascii = ord('a')
bins_of_char = np.zeros((N, 26),dtype=np.int)
num_of_anagram = 0

for i in range(N):
    S.append(input())

for i in range(N):
    for char in map(ord, S[i]):
        bins_of_char[i, char-a_ascii] += 1

for i in range(0, N-1):
    for j in range(i+1, N):
        if np.all(bins_of_char[i] == bins_of_char[j]):
            num_of_anagram += 1

print(num_of_anagram)

### FIXED CODE ###

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

# refered to editorial

import numpy as np

N = int(input())
S = []
hash_table = {}

a_ascii = ord('a')
bins_of_char = np.zeros((N, 26),dtype=np.int)
num_of_anagram = 0

for i in range(N):
    S.append(''.join(sorted(input())))
S = sorted(S)

for i in range(N):
    if S[i] in hash_table:
        num_of_anagram += hash_table[S[i]]
        hash_table[S[i]] += 1
    else:
        hash_table[S[i]] = 1


print(num_of_anagram)
### BUGGY CODE ###

N = int(input())
nums = [int(e) for e in input().split()]
nums.sort()

for i in range (1,N+1):
    c = nums.count(i)
    print(c)
    del nums[:int(c)]

### FIXED CODE ###

import collections as col

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

List = col.Counter(List)
Count_List = [0]*n
for i in List:
    Count_List[i-1] = List[i]

for i in range(0,len(Count_List)):
    print(Count_List[i])
### BUGGY CODE ###

#!/usr/bin/env python3
import sys
INF = float("inf")

MOD = 2  # type: int


import math
import collections


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors


def solve(N: int, a: "List[int]"):
    b = [0]*N
    for i in range(N-1, -1, -1):
        if b[i] % MOD == a[i]:
            b[i] = 0
        else:
            b[i] = 1
            for d in make_divisors(i+1)[:-1]:
                b[d-1] += 1

    c = [i+1 for i, val in enumerate(b) if val % 2 > 0]
    print(len(c))
    if len(c) != 0:
        print(*c, sep=" ")
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, a)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
INF = float("inf")

MOD = 2  # type: int


import math
import collections


def solve(N: int, a: "List[int]"):
    b = [0]*N
    for i in range(N-1, -1, -1):
        tmp = 0
        for j in range(2, N//(i+1)+1):
            tmp += b[j*(i+1)-1]
        if tmp % MOD == a[i]:
            b[i] = 0
        else:
            b[i] = 1

    c = [i+1 for i, val in enumerate(b) if val % 2 > 0]
    print(len(c))
    if len(c) != 0:
        print(*c, sep=" ")
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, a)


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

#!/usr/bin/env python3

import numpy as np

def is_prime(d):
    # O(d ** 0.5)
    assert d >= 1
    if d == 1:
        flag = False
    else:
        flag = True
        for t in range(2, d):
            if d % t == 0:
                flag = False
                break
            if t ** 2 > d:
                break
    return flag

def miller_rabin(n, k=50):
    # Mistake probability < 0.25 ** k
    # http://hamukichi.hatenablog.jp/entry/2016/02/17/215948
    assert n >= 1
    if n == 2:
        return True
    elif n == 1 or n % 2 == 0:
        return False
    # 2 ** s * d = n - 1
    d = n - 1
    s = 0
    while d % 2 == 0:
        d //= 2
        s += 1
    rng = np.random.RandomState(seed=0)
    for i in range(k):
        a = rng.randint(1, n - 1)
        if pow(a, d, n) != 1:
            for r in range(s):
                if pow(a, d * 2 ** r, n) == n - 1:
                    break
            else:
                return False
    return True

def pow(n, p, mod):
    if p == 0:
        return 1
    elif p % 2 == 0:
        x = pow(n, p // 2, mod)
        return (x * x) % mod
    else:
        x = pow(n, p - 1, mod)
        return (x * n) % mod

def get_list():
    res = [i * 5 + 6 for i in range(12000)]
    res = [x for x in res if miller_rabin(x)]
    return res[:55]

def main():
    n = int(input())
    res = get_list()
    print(*res[:n])

main()


### FIXED CODE ###

#!/usr/bin/env python3

def is_prime(d):
    assert d >= 1
    if d == 1:
        flag = False
    else:
        flag = True
        for t in range(2, d):
            if d % t == 0:
                flag = False
                break
            if t ** 2 > d:
                break
    return flag

def get_list():
    res = [i * 5 + 6 for i in range(12000) if is_prime(i * 5 + 6)]
    res = [x for x in res if is_prime(x)]
    return res[:55]

def main():
    n = int(input())
    res = get_list()
    print(*res[:n])

main()
### BUGGY CODE ###

inf = float('inf')
n,k=map(int,input().split())
h = list(map(int,input().split()))
dp=[0] + [inf] *(n-1)#初期化
for i in range(1,n):
    for j in range(1,k+1):#iからj離れた場所から来る場合と比較
        if i >=j:
            dp[i] = min(dp[i],abs(h[i-j]-h[i])+dp[i-j])
        else:break
print(dp[n-1])

### FIXED CODE ###

def main():
    inf = float('inf')
    n,k=map(int,input().split())
    h = list(map(int,input().split()))
    dp=[0] + [inf] *(n-1)#初期化
    for i in range(1,n):
        for j in range(1,k+1):#iからj離れた場所から来る場合と比較
            if i >=j:
                dp[i] = min(dp[i],abs(h[i-j]-h[i])+dp[i-j])
            else:break
    print(dp[n-1])

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

from functools import lru_cache

def main(S):
    con = 10**9 + 7

    @lru_cache(maxsize=1024)
    def get_c(iii):
        return [(j * iii) % 13 for j in l10]

    l10 = list(range(10))
    l13 = list(range(13))
    m13 = {i: {j: (i + j) % 13 for j in l13} for i in l13}
    c = []
    iii = 1
    for i in range(len(S)):
        s = S[len(S) - i - 1]
        if s != "?":
            c.append([(int(s) * iii) % 13])
        else:
            c.append(get_c(iii))
        iii = (iii * 10) % 13

    _tdp = {i: 0 for i in l13}
    it = iter(c)
    pdp = {i: 1 for i in next(it)}
    d = 1
    for v in it:
        tdp = _tdp.copy()
        for r in v:
            for _r, _v in pdp.items():
                tdp[m13[_r][r]] += _v
        if d == 0:
            for i in l13:
                tdp[i] = tdp[i] % con
        d = (d + 1) % 50
        pdp = tdp

    ans = pdp.get(5, 0)
    print(ans % con)

if __name__ == "__main__":
    S = input()
    main(S)


### FIXED CODE ###

S = input()
con = 10**9 + 7

T = [s if s != "?" else "0" for s in S]
T = int(''.join(T))
SS = T % 13

def get_mod(S):
    c = {}
    iii = 1
    for i in range(len(S)):
        if S[len(S) - i - 1] != "?":
            iii *= 10
            iii %= 13
            continue
        c[i] = {(j * iii) % 13: 1 for j in range(0, 10)}
        iii *= 10
        iii %= 13
    return c
c = get_mod(S)

def get_tdp(pdp):
    tdp = {i: 0 for i in range(13)}
    for r in v.keys():
        for _r, _v in pdp.items():
            tdp[(_r + r) % 13] += _v
    for i in range(13):
        tdp[i] %= con
    return tdp

pdp = {i: 0 for i in range(13)}
pdp[SS] += 1
for k, v in c.items():
    pdp = get_tdp(pdp)

ans = pdp[5]
print(ans)
### BUGGY CODE ###

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

def check_pow_two(n):
    while(n > 0):
        if n % 2 == 0:
            n //= 2
        elif n == 1:
            return True
        else:
            return False

ans = 0
while(len(A) > 0):
    a = A[0]
    A = A[1:]
    for i in range(len(A)):
        if check_pow_two(A[i] + a):
            ans += 1
            A.pop(i)
            break

print(ans)

### FIXED CODE ###

from collections import Counter

N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
c = Counter(A)

ans = 0
for a in A:
    b = (1 << a.bit_length()) - a
    if a == b and c[a] > 1:
        c[a] -= 2
        ans += 1
    elif a != b and c[a] > 0 and c[b] > 0:
        c[a] -= 1
        c[b] -= 1
        ans += 1

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

N = int(input())

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

B = []

for i in range(N+1):
    for j in range(N):
        if A[j] == i:
            B.append(j+1)
            break

print(" ".join(map(str, B)))

### FIXED CODE ###

import numpy as np

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

B = np.argsort(A, axis=0)
B = [n+1 for n in B]

print(" ".join(map(str, B)))
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
number = []
for i in range(1,n):
  number.append(a.count(i))
  print(number[i-1])
print(0)

### FIXED CODE ###

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