Harryxun/stf_run huggingface dataset:
import statistics
N = int(input())
A=list(map(int, input().split()))
B=[]
for number, i in enumerate(A, 1):
    B.append(i-number)
median = round(statistics.median(B))
ans2 = 0
for i in B:
    ans2 += abs(i-median)
print(ans2)

### FIXED CODE ###

import statistics  
N = int(input())
A=list(map(int, input().split()))
B=[]
for number, i in enumerate(A, 1):
    B.append(i-number)
median = int(statistics.median(B))
ans2 = 0
for i in B:
    ans2 += abs(i-median)
print(ans2)
while True:
    H, W = [int(i) for i in input().split()]
    if H == w == 0:
        break
    
    for h in range(H):
        for w in range(W):
            print('#',end='')
        
        print()
    
    print()

### FIXED CODE ###

while True:
    H, W = [int(i) for i in input().split()]
    if H == W == 0:
        break
    
    for h in range(H):
        for w in range(W):
            print('#', end='')
        print()
    
    print()
s = input()
t = input()

sset = set(s)
tset = set(t)
slist = list()
tlist = list()

for i in range(len(s)):
      smoji = s[i]
      if s[i] in slist:
         continue
 else:
      si = string(i)
      ss = s.replace(s[i], si)
for i in range(len(t)):
    tmoji = t[i]
    if t[i] in tlist:
      continue
    else:
      ti = string(i)
      ts = t.replace(t[i], ti)

if len(sset) != len(tset):
   print("No")
else:
   if ss != ts:
      print("No")
   else:
      print("Yes")



### FIXED CODE ###

S = input()
T = input()

i = 0
j = 0
ss = list()
tt = list()
slist = list()
tlist = list()

if len(S) == len(T):
   for s in S:
      if s in slist:
         ss.append(slist.index(s))
      else:
         ss.append(i)
         slist.append(s)
         i += 1

   for t in T:
      if t in tlist:
         tt.append(tlist.index(t))
      else:
         tt.append(j)
         tlist.append(t)
         j += 1

   if ss == tt:
      print("Yes")
   else:
      print("No")
else:
   print("No")
N = int(input())
A = list(map(int, input().split()))
counter = [0]*(max(A)+1)
dif = [-1, 0, 1]
for a in A:
    for d in dif:
        counter[a+d-1] += 1
print(max(counter))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
maxim = max(A)
counter = [0]*(maxim+1)
dif = [-1, 0, 1]
for a in A:
    for d in dif:
        i = a + d
        if i < 0 or maxim < i:
            continue
        else:
            counter[i] += 1
print(max(counter))
n = int(input())
nums = list(map(int,input().split()))
nums.sort()
ans = 0
cnt = {}
flag = [0]*1000000
for i in range(1,len(nums)):
  if nums[i] == nums[i-1]:
    flag[nums[i]] = 1

    
for i in range(len(nums)-1):
  if flag[nums[i]] == 0:
    ans += 1
  if nums[i] != nums[i+1]:
    n = nums[i]
    while n <1000000:
      flag[n] = 1
      n = n+ nums[i]

if flag[nums[-1]] == 0:
  ans +=1

print(ans)

### FIXED CODE ###

n = int(input())
nums = list(map(int,input().split()))
nums.sort()
ans = 0
cnt = {}
flag = [0]*1000005
for i in nums:
  cnt[i] = cnt.get(i,0) + 1

for i in nums:
  if flag[i] == 0 and cnt[i] == 1:
    ans += 1
  if flag[i] == 1:
    continue
  for j in range(i,1000001,i):
    flag[j] = 1

print(ans)
N, M, K = map(int, input().split())

parents = [-1] * N
friend = [set() for _ in range(N)]

def find(x):
	if parents[x] < 0:
		return x
	else:
		parents[x] = find(parents[x])
		return parents[x]

def union(x, y):
	x = find(x)
	y = find(y)

	if x == y:
		return

	if parents[x] > parents[y]:
		x, y = y, x

	parents[x] += parents[y]
	parents[y] = x

for _ in range(M):
	A, B = map(int, input().split())
	union(A-1, B-1)
	friend[A-1].add(B-1)
	friend[B-1].add(A-1)

a = [-parents[find(i)]-len(friend[i])-1 for i in range(N)]

for _ in range(K):
	C, D = map(int, input().split())
	if find[C-1] == find[D-1]:
		a[C-1] -= 1
		a[D-1] -= 1
print(*a)


### FIXED CODE ###

N, M, K = map(int, input().split())

parents = [-1] * N
friend = [set() for _ in range(N)]

def find(x):
	if parents[x] < 0:
		return x
	else:
		parents[x] = find(parents[x])
		return parents[x]

def union(x, y):
	x = find(x)
	y = find(y)

	if x == y:
		return

	if parents[x] > parents[y]:
		x, y = y, x

	parents[x] += parents[y]
	parents[y] = x

for _ in range(M):
	A, B = map(int, input().split())
	union(A-1, B-1)
	friend[A-1].add(B-1)
	friend[B-1].add(A-1)

a = [-parents[find(i)]-len(friend[i])-1 for i in range(N)]

for _ in range(K):
	C, D = map(int, input().split())
	if find(C-1) == find(D-1):
		a[C-1] -= 1
		a[D-1] -= 1
print(*a)
# -*- coding:utf-8 -*-
import sys
sys.setrecursionlimit(1000000)

def dfs(x, y, sym):
	tile[x][y] = "."
	for i in range(len(DX)):
		nx = x + DX[i]
		ny = y + DY[i]
		if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym:
			dfs(nx, ny, sym)

def solve():
	res = 0
	for i in range(N):
		for j in range(M):
			if tile[i][j] != ".":
				if tile[i][j] == "@":
					dfs(i, j, "@")
					res += 1
				elif tile[i][j] == "#":
					dfs(i, j, "#")
					res += 1
				elif tile[i][j] == "*":
					dfs(i, j, "*")
					res += 1
	return res
	
res=0	
counter=0
DX = [-1, 0, 1, 0]
DY = [0, -1, 0, 1]
while True:
	counter+=1
	line = input()
	if ' ' in line:
		nums = line.split(" ")
		N = int(nums[0])
		M = int(nums[1])
		tile = [[0 for i in range(N)]for j in range(M)]
		if N==0 and M==0:
			break
	else:
		tile[counter-2] = list(line)
	if (counter-1)==M:
		res = solve()
		counter = 0
		print(res)

### FIXED CODE ###

# -*- coding:utf-8 -*-
import sys
def dfs(x, y, sym):
	tile[x][y] = "."
	for i in range(len(DX)):
		nx = x + DX[i]
		ny = y + DY[i]
		if (0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym):
			dfs(nx, ny, sym)

def solve():
	res = 0
	for i in range(N):
		for j in range(M):
			sym = tile[i][j]
			if tile[i][j] != ".":
				if tile[i][j] is sym:
					dfs(i, j, sym)
					res += 1
	print(res)

counter=0
DX = [-1,0,1,0]
DY = [0,-1,0,1]
sys.setrecursionlimit(10**7)
while True:
	line = input()
	if " " in line:
		nums = line.split(" ")
		N = int(nums[0])
		M = int(nums[1])
		tile = [[0 for i in range(M)] for j in range(N)]
	else:
		tile[counter-1] = list(line)
	if N is 0 and M is 0:
		break
	counter += 1
	if counter-1 is N:
		solve()
		counter = 0
N=input()
A=input()
print(N*N-A)

### FIXED CODE ###

N=int(input())
A=int(input())
print(N*N-A)
N = int(input())
A = [tuple(map(int, input().split())) for _ in range(N)]
ans = []
import numpy as np
for zyun in itertools.permutations(range(N)):
    cnt = 0
    for k in range(len(zyun)-1):
        cnt += np.sqrt((A[zyun[k+1]][0]-A[zyun[k]][0])**2+(A[zyun[k+1]][1]-A[zyun[k]][1])**2 )
    ans.append(cnt)
print(sum(ans) / len(ans))

### FIXED CODE ###

N = int(input())
A = [tuple(map(int, input().split())) for _ in range(N)]
ans = []
import numpy as np
import itertools
for zyun in itertools.permutations(range(N)):
    cnt = 0
    for k in range(len(zyun)-1):
        cnt += np.sqrt((A[zyun[k+1]][0]-A[zyun[k]][0])**2+(A[zyun[k+1]][1]-A[zyun[k]][1])**2 )
    ans.append(cnt)
print(sum(ans) / len(ans))
N, M = map(int, input().split())
A = list(map(lambda x: int(x), input().split()))
Q = []

for i in range(M):
    Q.append(tuple(map(int, input().split())))

A.sort()

Q.sort(key=lambda x: x[1], reverse=True)

cur = 0
for i in range(M):
    cnt = Q[i][0]
    while A[cur] < Q[i][1] and cnt > 0 and cur < N:
        A[cur] = Q[i][1]
        cur += 1
        cnt -= 1
    
    if A[cur] >= Q[i][1]:
        break

print(sum(A))

### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(lambda x: int(x), input().split()))
Q = []

for i in range(M):
    Q.append(tuple(map(int, input().split())))

A.sort()

Q.sort(key=lambda x: x[1], reverse=True)

cur = 0
for i in range(M):
    cnt = Q[i][0]
    while cnt > 0 and cur < N:
        if A[cur] >= Q[i][1]:
            break
        A[cur] = Q[i][1]
        cur += 1
        cnt -= 1

print(sum(A))
a,b=map(int,input().split())
if not (a%3orb%3or(a+b)%3):
  print('Possible')
else:
  print('Impossible')

### FIXED CODE ###

a,b=map(int,input().split())
if not (a%3 and b%3 and (a+b)%3):
  print('Possible')
else:
  print('Impossible')
x,n =map(int,input().split())
 
if  n==0:
    print(x)
else:
    P =list(map(int,input().split()))
    for i in range(100):
        if  (x-i) not in P:
            print(x-i)
            break
        elif (x+i) not in P:
            print(x+i)
            break

### FIXED CODE ###

x = list(map(int, input().split()))
print(x.index(0) + 1)
a,b,c,d=map(int,input().split())
sum1=0
sum2=0
if a<=b:
    sum1=a
else:
    sum1=b
if c<=d:
    sum2=c
else:
    sum2=d
print(sum1+sum2)

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
d=int(input())
sum1=0
sum2=0
if a<=b:
    sum1=a
else:
    sum1=b
if c<=d:
    sum2=c
else:
    sum2=d
print(sum1+sum2)
N = int(input().strip())

X = {}
Y = {}

for _ in range(N):
  x, y = map(int, input().strip().split())
  if x not in X: X[x] = set()
  if y not in Y: Y[y] = set()
  X[x].add(y)
  Y[y].add(x)

count = 0
for x, y_set in X.items():
  if len(y_set) < 2:
    continue

  for y in y_set:
    x_set = Y[y]
    if len(x_set) < 2:
      continue

    for _x in x_set:
      if x == _x:
        continue

      count += len(y_set - X[_x])
      y_set |= X[_x]

print(count)

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

N = int(input().strip())

X = {}
Y = {}
G = (X, Y)

for _ in range(N):
  x, y = map(int, input().strip().split())
  if x not in X: X[x] = []
  if y not in Y: Y[y] = []
  X[x].append(y)
  Y[y].append(x)


def dfs_visit(visited, u, i):
  if u in visited[i]: return
  visited[i].add(u)
  for v in G[i][u]:
    dfs_visit(visited, v, (i + 1) % 2)


count = 0
i = 0
while len(X) > 0:
  visited = (set(), set())
  x = X.__iter__().__next__()
  dfs_visit(visited, x, 0)

  for x in visited[0]:
    count += len(visited[1]) - len(X.pop(x))

print(count)
s = raw_input()
s.reverse()
print s

### FIXED CODE ###

print raw_input()[::-1]
import numpy as np
import copy

N = int(input())
A = [int(i) for i in input().split()]
A = list(set(A))

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
def gcdover3(a):
    res = max(a)
    for idx in range(len(a)-1):
        res = min([gcd(a[idx],a[idx+1]),res])
    return res

if N<=2:
    print(max(A))
else:
    gcdss = []
    for i,a in enumerate(A):
        A_temp = copy.deepcopy(A)
        A_temp.pop(i)
        gcdss.append(gcdover3(A_temp))
    print(max(gcdss))

### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a  
lgcds = [A[0]]
rgcds = [A[N-1]]
for n in range(N-2):
    lgcds.append(gcd(lgcds[-1],A[n+1]))
    rgcds.append(gcd(rgcds[-1],A[-2-n]))
gcds = [lgcds[-1],rgcds[-1]]
for i in range(N-2):
    gcds.append(gcd(lgcds[i],rgcds[-2-i]))
print(max(gcds))
N, L = map(int, input().split())
S = []
for _ in range(N):
    S.append(input())

S.sort()
print()''.join(S))


### FIXED CODE ###

N, L = map(int, input().split())
S = []
for _ in range(N):
    S.append(input())

S.sort()
print(''.join(S))
import numpy as np

n, T = map(int, input().split())
c = np.zeros(n)
t = np.zeros(n)
for i in range(n):
    c_tmp, t_tmp = map(int, input().split())
    c[i] = (c_tmp)
    t[i] = (t_tmp)

tmp = c[t <= T]

if len(tmp) == 0:
    print("TLE")
else:
    print(int(min(tmp)))


### FIXED CODE ###

import numpy as np

n, T = map(int, input().split())
c = np.zeros(n)
t = np.zeros(n)
for i in range(n):
    c_tmp, t_tmp = map(int, input().split())
    c[i] = (c_tmp)
    t[i] = (t_tmp)

tmp = c[t <= T]

if len(tmp) == 0:
    print("TLE")
else:
    print(int(min(tmp)))
import math
a,b = map(int,input().split())
print(int((a*b)/math.gcd(a,b)))


### FIXED CODE ###

def gcd(a,b):
    return a if (b==0) else gcd(b,a%b)
a,b = map(int,input().split())
print(int((a*b)/gcd(a,b)))
from collections import deque
def cango(x,y):
    cand =[]
    if x+1<=H-1:
        cand.append((x+1,y))
    if x-1>=0:
        cand.append((x-1,y))
    if y+1<=W-1:
        cand.append((x,y+1))
    if y-1>=0:
        cand.append((x,y-1))
    return cand
    
q = deque([(-1,-1,0,0,0)]) 
been = [[False]*W for _ in range(H)]

while q:
    x_old,y_old,x_now,y_now,time = q.popleft()
    been[x_now][y_now]=True
    cand = cango(x_now,y_now)
    
    if x_now==H-1 and y_now==W-1:
        break
    
    for x_new,y_new in cand:
        if not been[x_new][y_new] and s[x_new][y_new]==".":
            q.append((x_now,y_now,x_new,y_new,time+1))

print( sum(ss.count(".") for ss in s)-time-1 )

### FIXED CODE ###

H,W = map(int,input().split())
s = [None]*H
for i in range(H):
    s[i] = input()

from collections import deque
def cango(x,y):
    cand =[]
    if x+1<=H-1:
        cand.append((x+1,y))
    if x-1>=0:
        cand.append((x-1,y))
    if y+1<=W-1:
        cand.append((x,y+1))
    if y-1>=0:
        cand.append((x,y-1))
    return cand
    
q = deque([(-1,-1,0,0,0)]) 
been = [[False]*W for _ in range(H)]

reach=False
while q:
    x_old,y_old,x_now,y_now,time = q.popleft()
    
    cand = cango(x_now,y_now)
    
    if x_now==H-1 and y_now==W-1:
        reach=True
        break
    
    for x_new,y_new in cand:
        if not been[x_new][y_new] and s[x_new][y_new]==".":
            q.append((x_now,y_now,x_new,y_new,time+1))
            been[x_new][y_new]=True
if reach:
    print( sum(ss.count(".") for ss in s)-time-1 )
else:
    print(-1)
inp = input().split()
a=inp[0]
b=inp[2]
if inp[1]=='+':
  print(a+b)
else:
  print(a-b)

### FIXED CODE ###

inp = input().split()
a=int(inp[0])
b=int(inp[2])
if inp[1]=='+':
  print(a+b)
else:
  print(a-b)
a,b=map(int,input().split())
if a>b:
    print("GREATER")
if a<b:
    print("LESS")
if a==b:
    print("EQUAL")

### FIXED CODE ###

a=int(input())
b=int(input())
if a>b:
    print("GREATER")
if a<b:
    print("LESS")
if a==b:
    print("EQUAL")
n, a, b = map(int, input().spalit())
pa = n * a
print(min(pa, b))

### FIXED CODE ###

n, a, b = map(int, input().split())
pa = n * a
print(min(pa, b))
r, c = map(int, raw_input().split())
sum_c = [0 for x in range(r)]
sum_r = [0 for x in range(c)]
sum = 0

for i in range(r):
    column = map(int, raw_input().split())
    for j in range(c):
        sum_c[i] += column[j]
        sum_r[j] += column[j]
        sum += column[j]
    print(" ".join(map(str, column)) + " " + str[sum_c[i])

print (" ".joint(map(str, sum_r)) + " " + str(sum))

### FIXED CODE ###

r, c = map(int, raw_input().split())
sum_c = [0 for x in range(r)]
sum_r = [0 for x in range(c)]
sum = 0

for i in range(r):
    column = map(int, raw_input().split())
    for j in range(c):
        sum_c[i] += column[j]
        sum_r[j] += column[j]
        sum += column[j]
    print(" ".join(map(str, column)) + " " + str(sum_c[i]))

print (" ".join(map(str, sum_r)) + " " + str(sum))
a = int(input().split())
b = int(input().split())
c = int(input().split())
d = int(input().split())
e = int(input().split())
k = int(input().split())

if e-a <= k:
	print("Yay!")
else :
	print(":(")

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e-a <= k:
	print("Yay!")
else:
	print(":(")
all=set()
for i in ['S','H','C','D']:
    for j in range(1,14):
        all=all.add('{0} {1}'.format(str(i), str(j)))
n=input() .split()
while o < n:
    a=input().split()
    t += str(a[0])
    r += str(a[1])
    o +=1
all2=set()
for y in t:
    for u in r:
        all2 = all2.add('{0} {1}'.format(str(y),str(u))
print(all-all2)

### FIXED CODE ###

data = [
    "{0} {1}".format(s, r)
    for s in ('S', 'H', 'C', 'D')
    for r in range(1, 13 + 1)
    ]
 
count = int(input())
for c in range(count):
    card = input()
    data.remove(card)
 
for c in data:
    print(c)
n, k = map(int, input().split())
s = list(map(int, list(input().strip())))


def count_zero(s, i):
    count = 0
    for j in range(i, len(s)):
        if s[j] == 0:
            count += 1
        else:
            break
    return count


def dfs(s, i, k, count):
    if i == len(s):
        return count
    elif s[i] == 1:
        count += 1
        return dfs(s, i + 1, k, count)
    else:
        if k > 0:
            c = count_zero(s, i)
            count += c
            return dfs(s, i + c, k - 1, count)
        else:
            return count


nums = []
for i in range(n):
    count = 0
    nums.append(dfs(s, i, k, count))
print(max(nums))

### FIXED CODE ###

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

streaks = []
c = s[0]
i = 1
count = 1
while True:
    if i == n:
        streaks.append(count)
        break
    if s[i] == c:
        i += 1
        count += 1
    else:
        streaks.append(count)
        c = s[i]
        i += 1
        count = 1

accs = [0]
for num in streaks:
    accs.append(accs[-1] + num)
if accs[-1] != n:
    accs.append(n)

flag = s[0] == '0'
res = []
for i in range(len(accs)):
    if flag:
        index = i + 2 * k
    else:
        index = i + 2 * k + 1
    index = min(index, len(accs) - 1)
    res.append(accs[index] - accs[i])
    flag = not flag

print(max(res))
import sys
sum = 1;
for i in sys.stdin.strip():
    if i != "0":
        print('Case {}: {}'.format(sum, i))
        sum++
    else:
        break

### FIXED CODE ###

import sys
sum = 1;
for i in sys.stdin:
    x = i.strip()
    if x != "0":
        print('Case {}: {}'.format(sum, x))
        sum+= 1
    else:
        break
def even_line(w):
    s=''
    for i in range(0,w):
        if i%2 == 0:
            s=s+'#'
        else:
            s=s+'.'
    print(s)
    return 0

def odd_line(w):
    s=''
    for i in range(0,w):
        if i%2 == 0:
            s=s+'.'
        else:
            s=s+'#'

    print(s)
    return 0

if __name__ == '__main__':

    h, w = map(int, input().split())

    while (h != 0) and (w != 0):
        for i in range(0,h):
            if i%2==0:
                even_line(w)
            else:
                odd_line(w)
　　　　　　print()
        h, w = map(int, input().split())


### FIXED CODE ###

def even_line(w):
    s=''
    for i in range(0,w):
        if i%2 == 0:
            s=s+'#'
        else:
            s=s+'.'
    print(s)

def odd_line(w):
    s=''
    for i in range(0,w):
        if i%2 == 0:
            s=s+'.'
        else:
            s=s+'#'

    print(s)

if __name__ == '__main__':

    h, w = map(int, input().split())

    while (h != 0) and (w != 0):
        for i in range(0,h):
            if i%2==0:
                even_line(w)
            else:
                odd_line(w)
        h, w = map(int, input().split())
        print()
import numpy as np

n,a=map(int,input().split())
print(n*n-a)

### FIXED CODE ###



import numpy as np

n=int(input())
a=int(input())
print(n*n-a)
for _ in [0]*int(input()):
    s=input()
    if s[:2]=='>\'' and s[-1]=='~':
        a=s[2:-1].split('#')
        print(['NA','A'][set(a[0])==set(a[1])=={'='} and len(set(a))==1])
    elif s[:2]=='>^' and s[-2:]=='~~':
        s=s[2:-2]
        print(['NA','B'][len(s)==2*s.count('Q=')])

### FIXED CODE ###

for _ in [0]*int(input()):
    s=input()
    a='NA'
    if s[:2]==">'" and s[-1]=='~' and '#' in s:
        s=s[2:-1].split('#')
        a=[a,'A'][set(s[0])==set(s[1])=={'='} and len(set(s))==1]
    elif s[:2]=='>^' and s[-2:]=='~~':
        s=s[2:-2]
        a=['NA','B'][len(s)==2*s.count('Q=') and len(s)>0]
    print(a)
N, K = map(int, input().split())
A = list(map(int, input().split()))
max_A = max(A)
A.sort()

if(max_A < K):
    print("IMPOSSIBLE")
else:
    num = 10**10
    for i in range(N-1):
        num = min(num, abs(A[i]-A[i+1]))

    for i in range(N):
        if(A[i] < K):
            continue
        if((K-A[i])%num == 0):
            print("POSSIBLE")
            break
    else:
        print("IMPOSSIBLE")

### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
max_A = max(A)
A.sort()

if(max_A < K):
    print("IMPOSSIBLE")
else:
    num = 10**10
    for i in range(N-1):
        if(min(num, abs(A[i]-A[i+1]))):
            num = min(num, abs(A[i]-A[i+1]))

    for i in range(N):
        if(A[i] < K):
            continue
        if((K-A[i])%num == 0):
            print("POSSIBLE")
            break
    else:
        print("IMPOSSIBLE")
counter = 1
while true:
    x = input()
    if x == 0 : 
        break
        print("Case {}: {}".format(counter,input()))



### FIXED CODE ###

ans = []
for i, x in enumerate(open(0).readlines()):
    ans.append("Case %d: %s" % (i+1, x))
open(1,'w').writelines(ans[:-1])
from numpy import *
input()
a=array(input().split())
d=a-minimum.accumulate(a)
print((d==d.max()).sum())


### FIXED CODE ###

import numpy as np

input()
a = np.array(input().split(), dtype=np.int)

diff = a - np.minimum.accumulate(a)
print((diff == diff.max()).sum())
N=int(input())
A=list(map(int,input().split()))
ans=0
for a in range(N):
  newA = [A[a]%n for n in A]
  newA.pop(a)
  print(newA)
  if 0 in newA:
    ans = ans
  else:
    ans += 1
  
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
A.sort()
Amax = A[-1]
dp = [1]*(Amax+1)
ans = 0
for i in range(len(A)-1):
  p = A[i]
  if dp[p] == 1:
    for q in range(Amax//p+1):
      dp[p*q] = 0
    if A[i] != A[i+1]: 
      ans += 1
if dp[Amax] == 1:
  ans += 1
print(ans)
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
l = [a,b,c,d,e]
h = 0
j =[]
for i in range(0, 5):
    f = l[i] // 10
    g = l[i] % 10
    if not(g == 0):
        f = f + 1
        j.append(g)
    f = f * 10
    h = h + f
    
if not(g == []):
    h = h + min(j) -10
print(h)

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
l = [a,b,c,d,e]
h = 0
j =[]
for i in range(0, 5):
    f = l[i] // 10
    g = l[i] % 10
    if not(g == 0):
        f = f + 1
        j.append(g)
    f = f * 10
    h = h + f
    
if not(j == []):
    h = h + min(j) -10
print(h)
k,s=map(int,input().split())
ans=0
for x in range(k+1):
     for y in range(k+1):
        z=s-x-y
        if 0<=z and z<=k
            ans+=1
print(ans)


### FIXED CODE ###

k,s=map(int,input().split())
ans=0
for x in range(k+1):
     for y in range(k+1):
        z=s-x-y
        if 0<=z and z<=k:
            ans+=1
print(ans)
a=int
b=int
c=a*b%2

if c==0:
  print(even)
else:
  print(odd)
  

### FIXED CODE ###

a,b=input().split()
aa=int(a)
bb=int(b)
if aa*bb%2==0:
  print('Even')
else:
  print('Odd')
from sys import setrecursionlimit
setrecursionlimit(10 ** 6)


def popcount(n):
    return bin(n).count("1")

cache = [-1] * (2 * 10 ** 5 + 1)


def f(n):
    if cache[X] != -1:
        return cache[X]
    return f(n % popcount(n)) + 1

def g(n, m):
    if n < 60:
        return (1 << n) % m
    else:
        t = n // 2
        return g(t, m) * g(n - t, m) % m


N = int(input())
X = input()

c = X.count('1')
t1 = [0] * N
t2 = [0] * N
for i in range(N):
    n = N - 1 - i
    t1[i] = g(n, c - 1)
    t2[i] = g(n, c + 1)

x1, x2 = 0, 0
for i in range(N):
    if X[i] == '1':
        x1 += t1[i]
        x2 += t2[i]

result = []
for i in range(N):
    if X[i] == '1':
        n = x1 - t1[i]
        n %= c - 1
    elif X[i] == '0':
        n = x2 + t2[i]
        n %= c + 1
    result.append(f(n) + 1)
print(*result, sep='\n')


### FIXED CODE ###

def popcount(n):
    return bin(n).count("1")


def f(n):
    if n == 0:
        return 0
    return 1 + f(n % popcount(n))


N = int(input())
X = input()

c = X.count('1')
t1 = [0] * N
t1[0] = 1 % (c + 1)
for i in range(1, N):
    t1[i] = (t1[i - 1] << 1) % (c + 1)
x1 = 0
for i in range(N):
    if X[i] == '0':
        continue
    x1 += t1[N - 1 - i]

if c - 1 != 0:
    t2 = [0] * N
    t2[0] = 1 % (c - 1)
    for i in range(1, N):
        t2[i] = (t2[i - 1] << 1) % (c - 1)
    x2 = 0
    for i in range(N):
        if X[i] == '0':
            continue
        x2 += t2[N - 1 - i]

result = []
for i in range(N):
    if X[i] == '0':
        n = (x1 + t1[N - 1 - i]) % (c + 1)
    elif X[i] == '1':
        if c - 1 == 0:
            result.append(0)
            continue
        n = (x2 - t2[N - 1 - i]) % (c - 1)
    result.append(1 + f(n))
print(*result, sep='\n')