Harryxun/stf_run huggingface dataset:
import sys
import collections as col
import numpy as np


def main():
    n = int(input())
    aarray = [int(e) for e in input().split()]
    aqueue = col.deque(sorted(aarray))
    record = []
    while len(aqueue) > 2:
        amin = aqueue.popleft()
        amax = aqueue.pop()
        record.append((amin, amax))
        anext = aqueue.pop()
        record.append((anext, (amin - amax)))
        aqueue.append(anext - (amin - amax))
        aqueue = sorted(aqueue)
    if len(aqueue) == 2:
        amin = aqueue.popleft()
        amax = aqueue.pop()
        print(amax - amin)
        record.append((amax, amin))
    else:
        print(aqueue.pop())
    for r in record:
        print(r[0], r[1])


main()


### FIXED CODE ###

import sys
import collections as col
import bisect
import numpy as np


def main():
    n = int(input())
    aarray = [int(e) for e in input().split()]
    aarray.sort()
    record = []
    endpoint = max(1, bisect.bisect(aarray, 0))
    aqueue = col.deque(aarray)
    while len(aqueue) > endpoint + 1:
        amax = aqueue.pop()
        amin = aqueue.popleft()
        record.append((amin, amax))
        aqueue.appendleft(amin - amax)
    amax = aqueue.pop()
    while len(aqueue) > 0:
        amin = aqueue.popleft()
        record.append((amax, amin))
        amax -= amin
    print(amax)
    for r in record:
        print(r[0], r[1])


main()
import numpy as np

N, M = map(int, input().split())
As = list(map(int, input().split()))
As = np.array(As)

B = []
C = []
for _ in range(M):
  Bs, Cs = map(int, input().split())
both = zip(Bs, Cs)
both.sort()
Bs, Cs = zip(*both)
for k in reversed(range(N)):
  As.sort()
  b = Bs[k]
  c = Cs[k]
  cnt = (As < c).sum()
  if cnt == 0:
    break
  else:
    if b > cnt:
      for l in range(cnt):
        As[l] = c
    else:
      for l in range(b):
        As[l] = c
print(As.sum())

### FIXED CODE ###

N, M = map(int, input().split())
As = list(map(int, input().split()))
ones = [1 for _ in range(N)]
Bs = []
Cs = []
both = list(zip(As, ones))
for _ in range(M):
  b, c = map(int, input().split())
  both.append((c, b))
both.sort()
a, b = zip(*both)
cnt = 0
out = 0
for k in reversed(range(N+M)):
  if N - cnt > b[k]:
    out += a[k] * b[k]
    cnt += b[k]
  else:
    out += a[k] * (N - cnt)
    break
print(out)
N, Q = map(int, input().split())

tree = [[0] for i in range(N)]


tree_list = [0] * N
end = [0] * N

for index in range(N - 1):
    a, b = map(lambda x: int(x) - 1, input().split())
    tree[a].append(b)
    tree[b].append(a)

for index in range(Q):
    a, b = map(int, input().split())
    a -= 1
    tree_list[a] += b


def iter(node):
    end[node] = -1
    child = tree[node]
    for c in child:
        if end[c] == 0:
            tree_list[c] += tree_list[node]
            iter(c)


iter(0)

print(*tree_list)


### FIXED CODE ###

import sys

sys.setrecursionlimit(10000000)
input = sys.stdin.readline

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

tree = [[0] * 1 for i in range(N)]


tree_list = [0] * N
end = [0] * N

for index in range(N - 1):
    a, b = map(lambda x: int(x) - 1, input().split())
    tree[a].append(b)
    tree[b].append(a)

for index in range(Q):
    a, b = map(int, input().split())
    a -= 1
    tree_list[a] += b


def iter(node):
    end[node] = -1
    child = tree[node]
    for c in child:
        if end[c] == 0:
            tree_list[c] += tree_list[node]
            iter(c)


iter(0)

print(*tree_list)
# coding:utf-8

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

if K == 1:
    print(S[0])
else:
    S5000 = ''
    for i in range(len(S)):
        s = S[i]
        if s == '1':
            continue
        else:
            digit = i
            tmp = s
            break
    else:
        digit = len(S)

if K <= digit:
    print('1')
else:
    print(tmp)

### FIXED CODE ###

# coding:utf-8

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

for i in range(K):
    if S[i] != '1':
        print(S[i])
        break
else:
    print('1')
n = int(input())

if n == 1:
	G = [1]
else:
	G = [g for g in [1, 4, 10, 23, 57, 132, 301, 701] if g < n]
	while True:
		g = int(2.25 * G[-1])
		if g > n:
			break
		G.append(g)
	G.reverse()

A = [int(input()) for _ in range(n)]
cnt = 0
for g in G:
	for j, v in enumerate(A[g:]):
		while j >= 0 and A[j] > v:
			A[j+g] = A[j]
			j -= g
			cnt += 1
		A[j+g] = v

print(len(G))
print(*G)
print(cnt, *a, sep='\n')


### FIXED CODE ###

import sys

n = int(input())
if n == 1:
	G = [1]
else:
	G = [g for g in [1, 4, 10, 23, 57, 132, 301, 701] if g < n]
	while True:
		g = int(2.25 * G[-1])
		if g > n:
			break
		G.append(g)
	G.reverse()

A = list(map(int, sys.stdin))
cnt = 0
for g in G:
	for j, v in enumerate(A[g:]):
		while j >= 0 and A[j] > v:
			A[j+g] = A[j]
			j -= g
			cnt += 1
		A[j+g] = v

print(len(G))
print(*G)
print(cnt)
for a in A:
	print(a)
def main():
    n = int(input())
    A = [int(i) for i in input().split()]

    max_dp = max(A) + 1
    dp = [0] * max_dp

    for a in A:
        if dp[a] >= 2:
            continue
        dp[a] += 1
        for i in range(a << 1, max_dp, a):
            dp += 2
    print(np.sum(dp == 1))


if __name__ == '__main__':
    main()

### FIXED CODE ###

import numpy as np
import sys
input = sys.stdin.readline


def main():
    n = int(input())
    A = np.array([int(i) for i in input().split()])

    max_dp = np.max(A) + 1
    dp = np.zeros(max_dp, dtype="int32")

    for a in A:
        if dp[a] >= 2:
            continue
        fancy = np.arange(a, max_dp, a)
        dp[fancy] += 2
        dp[a] -= 1
    print(np.sum(dp == 1))


if __name__ == '__main__':
    main()
H, W = map(int, input().split())
s_list = []
for _ in range(H):
    s = input()
    s_list.append(s)
ans = 0
for h in range(H):
    for w in range(W):
        if s_list[h][w] == '.':
            d = deque()
            d.append([h, w])
            visited = set({})
            while d:
                i, j = d.pop()
                visited.add(str(i) + '_' + str(j))
                for ii, jj in [[1, 0], [-1, 0], [0, 1], [0, -1]]:
                    if (0 <= (i + ii) < H) & (0 <= (j + jj) < W):
                        if str(i + ii) + '_' + str(j + jj) not in visited:
                            if s_list[i][j] != s_list[i + ii][j + jj]:
                                d.append([i + ii, j + jj])
                                if s_list[i + ii][j + jj] == '#':                                    
                                    ans += 1
                            visited.add(str(i + ii) + '_' + str(j + jj))
print(ans)

### FIXED CODE ###

from collections import deque
H, W = map(int, input().split())
s_list = []
for _ in range(H):
    s = input()
    s_list.append(s)
ans = 0
visited = set({})
for h in range(H):
    for w in range(W):
        if s_list[h][w] == '.':
            if str(h) + '_' + str(w) not in visited:
                d = deque()
                d.append([h, w])
                plus = 1
                minus = 0
                while d:
                    i, j = d.pop()
                    visited.add(str(i) + '_' + str(j))
                    for ii, jj in [[1, 0], [-1, 0], [0, 1], [0, -1]]:
                        if (0 <= (i + ii) < H) & (0 <= (j + jj) < W):
                            if str(i + ii) + '_' + str(j + jj) not in visited:
                                if s_list[i][j] != s_list[i + ii][j + jj]:
                                    d.append([i + ii, j + jj])
                                    visited.add(str(i + ii) + '_' + str(j + jj))
                                    if s_list[i + ii][j + jj] == '.':
                                        plus += 1
                                    else:
                                        minus += 1                                
                ans += plus * minus
print(ans)
N = int(input())
A = list(map(int,input().split()))

asorted = sorted(A)
print(asorted[N+1]-asorted[0])

### FIXED CODE ###

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

asorted = sorted(A)
print(asorted[N-1]-asorted[0])
def resolve():
    N = int(input())
    A = sorted(map(int, input().split()))

    counter = collections.Counter(A)
    ans = 0

    for i in counter.values():
        ans += i * (i - 1) // 2

    for a in A:
        count = counter[a]
        print(ans - (count * (count - 1) // 2) +
              ((count - 1) * (count - 2) // 2))

resolve()

### FIXED CODE ###

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

from collections import Counter
C=Counter(A)
ANS=0
for i in C.values():
    ANS+=i*(i-1)//2

for a in A:
    k=C[a]

    print(ANS-(k*(k-1)//2)+((k-1)*(k-2)//2))
import sys
def rr(): return sys.stdin.readline().rstrip()
def rri(): return int(rr())
def rrl(): return list(map(int, rr().split()))
def rrt(): return tuple(map(int, rr().split()))
def rrle(): return (line.rstrip() for line in sys.stdin.readlines())
def rrtl(): return [tuple(map(int, l.split())) for l in rrle()]
from collections import defaultdict
def mus(d=lambda: 0): return defaultdict(lambda: defaultdict(d))
def dd0(d=lambda: 0): return defaultdict(d)
def ms(x, y, d=0): return [[0]*y for i in range(x)]
def ar(x, d=0): return [d]*x
def ppm(m, n=0, x=0, y=0): print("\n".join(("\t".join((str(m[j][i]) for j in range(y or n))) for i in range(x or n))))
def ppa(a, n): print("\t".join(map(str, a[0:n])))
def ppl(a=0, x=[1]): x[0]=a or (x[0]+1); print("-"+"- -"*14+"-# "+str(x[0]-2)+" #-"+"- -"*14+"-")
def fltn(a): (i for sub in a for i in sub)
def yn(x): return "YES" if x else "NO"
from itertools import accumulate
from itertools import groupby
def grp(x): return ((i, sum(1 for _ in g)) for i, g in groupby(x))
import math
def rnar(): return (*rrl(), rrl())
def rn(): return (*rrl(),)
def dpp(a, b=""): print("#| {} |#:^ {} ^:".format(a, b))

def read():
    return (rri(),)

def solve(x):
    arr = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
    ans = arr[x-1]
    return ans

if __name__ == "__main__":
    #test_count = rri()
    test_count = 1
    for _ in range(test_count):
        input_data = read()
        result = solve(*input_data)
        print(result)


### FIXED CODE ###

import sys
def rr(): return sys.stdin.readline().rstrip()
def rri(): return int(rr())
def rrl(): return list(map(int, rr().split()))
def rrt(): return tuple(map(int, rr().split()))
def rrle(): return (line.rstrip() for line in sys.stdin.readlines())
def rrtl(): return [tuple(map(int, l.split())) for l in rrle()]
from collections import defaultdict
def mus(d=lambda: 0): return defaultdict(lambda: defaultdict(d))
def dd0(d=lambda: 0): return defaultdict(d)
def ms(x, y, d=0): return [[0]*y for i in range(x)]
def ar(x, d=0): return [d]*x
def ppm(m, n=0, x=0, y=0): print("\n".join(("\t".join((str(m[j][i]) for j in range(y or n))) for i in range(x or n))))
def ppa(a, n): print("\t".join(map(str, a[0:n])))
def ppl(a=0, x=[1]): x[0]=a or (x[0]+1); print("-"+"- -"*14+"-# "+str(x[0]-2)+" #-"+"- -"*14+"-")
def fltn(a): (i for sub in a for i in sub)
def yn(x): return "YES" if x else "NO"
from itertools import accumulate
from itertools import groupby
def grp(x): return ((i, sum(1 for _ in g)) for i, g in groupby(x))
import math
#def rnar(): return (*rrl(), rrl())
#def rn(): return (*rrl(),)
def dpp(a, b=""): print("#| {} |#:^ {} ^:".format(a, b))

def read():
    return (rri(),)

def solve(x):
    arr = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
    ans = arr[x-1]
    return ans

if __name__ == "__main__":
    #test_count = rri()
    test_count = 1
    for _ in range(test_count):
        input_data = read()
        result = solve(*input_data)
        print(result)
# BA=0, B=0, A=0, 0
# BA=2, B=0, A=0, 1
# BA=0, B=1, A=0, 0
# BA=0, B=0, A=1, 0
# BA=2, B=1, A=0, 2
# BA=2, B=0, A=1, 2
# BA=2, B=1, A=1, 2

n = int(input())
 
ans = 0
A = 0
B = 0
AB = 0
for _ in range(n):
    s = input()
    ans += s.count('AB')
    
    if s[-1] == 'A' and s[0] != 'B':
        A += 1 
    if s[0] == 'B' and s[-1] != 'A':
        B += 1
    if s[-1] == 'A' and s[0] == 'B':
        AB += 1
    
ans += min(A+AB, B+AB)


if AB>0 and A+B==0:
    ans -= 1

print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
print(n-k+1)
n = int(input())

M = pow(10, 9) + 7
import sys

dc = {}
al = [0]

rr = [1]


def search(ss, start, end):
    z = al[(start + end)//2]
    nz = al[(start + end)//2+1]
    if z <= ss and ss < nz:
        return (start+end)//2
    elif ss < z:
        return search(ss, start, (start+end)//2)
    else:
        return search(ss, (start+end)//2+1, end)

c = 0
cn = 0
for line in sys.stdin:
    a = int(line)
    if a in dc:
        ss = dc[a]
        if ss != c-1:
            if ss >= al[cn]:
                rr.append((rr[cn]*2)%M)
            else:
                i = search(ss, 0, cn)
                rr.append((rr[cn] + rr[i])%M)
            al.append(c)
            cn += 1
    dc[a] = c
    c += 1
print(rr[cn]%M)


### FIXED CODE ###

import collections
M = pow(10, 9) + 7
input()
s = input().strip()
r=1
for x in collections.Counter(s).values():
    r = (r*(x+1)) %M
print(r-1)
# D - Alter Altar

from collections import deque

N = int(input())
c = list(str(input()))
dw = deque()
dr = deque()

for i, c in enumerate(c, 1):
    if c == 'W':
        dw.append(i)
    else:
        dr.appendleft(i)

ans = 0
while dw:
    w = dw.popleft()
    r = dr.popleft()
    if w < r:
        ans += 1

    else:
        break
print(ans)

### FIXED CODE ###

from collections import deque

N = int(input())
c = list(str(input()))
dw = deque()
dr = deque()

for i, c in enumerate(c, 1):
    if c == 'W':
        dw.append(i)
    else:
        dr.appendleft(i)

ans = 0
while dw and dr:
    w = dw.popleft()
    r = dr.popleft()
    if w < r:
        ans += 1

    else:
        break
print(ans)
H , W = map(int, input().split())
S = H * W

if S % 2 == 0:
    print(S//2)
else:
    print(S//2+1)


### FIXED CODE ###

K = int(input())
alist = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(alist[K-1])
n = int(input())
a = [int(_) for _ in input().split()]

sub_num = [0]*(2*10**6)

for i in range(1, n+1):
#    print(abs(int(a[i-1]-i)))
    sub_num[abs(int(a[i-1]-i))] += 1

b = -sub_num.index(max(sub_num))
#print(b)

result = 0
for i in range(1, n+1):
    result += abs(a[i-1] - (b + i))

print(result)

### FIXED CODE ###

import numpy as np

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

sub_num = []

for i in range(1, n+1):
#    print(abs(int(a[i-1]-i)))
    sub_num.append(int(a[i-1]-i))


b = np.median(sub_num)
#print(b)

result = 0
for i in range(n):
    result += abs(sub_num[i] - b)

print(int(result))
S_ = input()
T = input()
ans = list(S_)
for i in range(len(T)):
    if T[i] in S_:
        prev = len(S_)
        while(1):
            id = S_.rfind(T[i], 0, prev-1)
            if id < 0:
                break
			prev = id
            flag = True
            for j in range(i+1, len(T)):
                if S_[id + j - i] == T[i] or S_[id + j - i] == "?":
                    continue
                else:
                    flag = False
                    break
                for j in reversed(range(i)):
                    if S_[id - j - 1] == T[i - j - 1] or S_[id - j - 1] == "?":
                        continue
                    else:
                        flag = False
                        break
            if flag:
                ans[id - i:id - i + len(T)] = T
                for i in range(len(ans)):
                    if ans[i] == "?":
                        ans[i] = "a"
                print("".join(ans))
                exit(0)


print("UNRESTORABLE")


### FIXED CODE ###

S_ = input()
T = input()
ans = list(S_)


def check(S1, S2):
    for i in range(len(S1)):
        if S1[i] == S2[i] or S1[i] == "?":
            continue
        else:
            return(False)

    return(True)


for i in reversed(range(len(S_) - len(T) + 1)):
    result = check(S_[i:i+len(T)], T)
    if result:
        for j in range(len(T)):
            ans[i+j] = T[j]
        for j in range(len(ans)):
            if ans[j] == "?":
                ans[j] = "a"
        print("".join(ans))

        exit(0)

print("UNRESTORABLE")
h, a = input()

h = int(h)
a = int(a)

cnt = 0

while (h > 0):
	h -= a
	cnt += 1

print(cnt)

### FIXED CODE ###

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

cnt = 0

while (h > 0):
	h -= a
	cnt += 1

print(cnt)
s = input()
l = ["Sunny", "Cloudy", "Rainy"]

print(l[l.index(s)+1])

### FIXED CODE ###

s = input()
l =["Sunny", "Cloudy", "Rainy", "Sunny"]

print(l[l.index(s)+1])
a = list(map(int, input().split()))
print('Yes' if max(a) *2 = sum(a) else 'No')

### FIXED CODE ###

a = list(map(int, input().split()))
print('Yes' if max(a) *2 == sum(a) else 'No')
n, a = [int(i) for i in input().split()]
x = [int(i)-a for i in input().split()] 

max = max(x)

dp = [[0 for _ in range(2*n*max+1)] for _ in range(n+1)]

dp[0][n*max] = 1 

for i in range(1, n+1):
	for j in range(2*n*max+1):
		if j - x[i-1] < 0 or j - x[i-1] > 2*n*max:
			dp[i][j] = dp[i-1][j]
		else: 
			dp[i][j] = dp[i-1][j] + dp[i-1][j-x[i-1]]

print(dp[n][n*max]-1)







# # def function(i, j, x):
# 	print(0)
# 	if i == 0 and j == 0:
# 		return 1
# 	elif i == 0 and j == x[0]:
# 		return 1
# 	else:
# 		return function(i-1, j, x) + function(i-1, j-x[i], x)

### FIXED CODE ###

n, a = [int(i) for i in input().split()]

x = [int(i) for i in input().split()] 
y = [int(i)-a for i in x] 


max = max(x)

dp = [[0 for _ in range(2*n*max+1)] for _ in range(n+1)]

dp[0][n*max] = 1 

for i in range(1, n+1):
	for j in range(2*n*max+1):
		if j - y[i-1] < 0 or j - y[i-1] > 2*n*max:
			dp[i][j] = dp[i-1][j]
		else: 
			dp[i][j] = dp[i-1][j] + dp[i-1][j-y[i-1]]

result = dp[n][n*max]-1

print(result)
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


def lcm(a, b):
    return int(a * b / gcd(max(a, b), min(a, b)))


N = int(input())
T = [int(input()) for i in range(N)]
A = T[0]
for i in range(1, N):
    A = lcm(A, T[i])
print(A)


### FIXED CODE ###

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


def lcm(a, b):
    return a * b // gcd(max(a, b), min(a, b))


N = int(input())
T = [int(input()) for i in range(N)]

A = T[0]
for i in range(N):
    A = lcm(A, T[i])
print(A)
import math
from functools import reduce
import numpy as np
N, X = map(int, input().split())
xlist = list(map(int, input().split()))
xlist.append(X)
xlist.sort()
sa = list(np.array(xlist[1:]) - np.array(xlist[:-1]))
print(reduce(math.gcd, sa))

### FIXED CODE ###

import fractions
from functools import reduce
import numpy as np
N, X = map(int, input().split())
xlist = list(map(int, input().split()))
xlist.append(X)
xlist.sort()
sa = list(np.array(xlist[1:]) - np.array(xlist[:-1]))
print(reduce(fractions.gcd, sa))
num = int(input())
ls = list(map(str, input().split(" ")))

diff = 0
for i in range(num):
    if (ls[i] != i+1):
        diff += 1

if diff == 2 or diff == 0:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

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

if (a + b) % 2 != 0:
    print("IMPOSSIBLE")
else:
    print(int((a + b) / 2))
from heapq import heappush, heappop

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

# works[i] : M-i日に報酬が得られるリスト
works = [[] for _ in range(10**4)]

for _ in range(N):
    A, B = map(int,input().split())
    A -= 1
    # 報酬が得られる日付に応じて格納
    works[A].append(B)

hq = []
ans = 0

for i in range(M):
    # M-i日から降順に仕事の候補リストを作る
    for w in works[i]:
        # 大きいものから選びたいのでマイナスをかける
        heappush(hq, -w)
    # M-i日の時点で報酬が最大の仕事を選ぶ
    if hq:
        ans += -heappop(hq)

print(ans)

### FIXED CODE ###

from heapq import heappop, heappush
from bisect import bisect
from collections import deque
inf = 10**5


N, M = map(int,input().split())
info = [list(map(int,input().split())) for _ in range(N)]
info = deque(sorted(info))

ans = 0
hq = []

for i in range(M-1,-1,-1):
    index = bisect(info, [M-i,inf])
    for _ in range(index):
        A, B = info.popleft()
        heappush(hq, -B)
    if hq:
        B = -heappop(hq)
        ans += B

print(ans)
from collections import deque
N, M = map(int, input().split())
pair={}

for _ in range(M):
    a, b = map(int, input().split())
    if a not in pair:
        pair[a-1]=[b-1]
    else:
        pair[a-1].append(b-1)
    if b not in pair:
        pair[b-1]=[a-1]
    else:
        pair[b-1].append(a-1)
# print(pair)

did=[]
ans=-1
queue=deque()
for i in range(N):
    if i not in did:
        queue.append(i)
    else:
        continue
    while(queue):
        now=queue.pop()
        did.append(now)
        # print(now)
        if now in pair:
            for j in pair[now]:
                if j not in queue and j not in did:
                    queue.append(j)
    ans+=1
print(ans)











### FIXED CODE ###

import networkx as nx
N, M = map(int, input().split())

G=nx.Graph()

for _ in range(M):
    a, b = map(int, input().split())
    G.add_edge(a,b)

tmp= list(nx.connected_components(G))

count=0

for i in tmp:
    count+=len(i)


print(N-count+len(tmp)-1)
a, b= map(int, input().split())
d=int(a/b)
r=a%b
f=a/b
print(a, b, c)


### FIXED CODE ###

a, b= map(int, input().split())
d=a//b
r=a%b
f=a/b
print('{0} {1} {2:.5f}'.format(d, r, f))
N = int(input())
A = list(map(int, input().split()))
S = set(A)
M = max(S)
A.sort()

for a in A:
    if a == pre_a:
        S.discard(a)
    if a in S:
        j = a * 2
        while j <= M:
            S.discard(j)
            j += a
    pre_a = a
print(len(S))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
S = set(A)
M = max(S)
A.sort()

pre_a = 0
for a in A:
    if a == pre_a:
        S.discard(a)
    if a in S:
        j = a * 2
        while j <= M:
            S.discard(j)
            j += a
    pre_a = a
print(len(S))
a1 = input()
a2 = input()
t = 0

for i in range(len(a1)):
  if a1[i] != a2[i]:
    a += 1
    
print(a)

### FIXED CODE ###

a1 = input()
a2 = input()
t = 0

for i in range(len(a1)):
  if a1[i] != a2[i]:
    t += 1
    
print(t)
if __name__ == '__main__':
    n = int(input())
    c = 0

    for i in range(1, n + 1):
        if i % 2 == 0:
            continue
        if count_divisor(i) == 8:
            c += 1
    print(c)

### FIXED CODE ###

def count_divisor(n):
    a = 0
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            a += 1
            if i != n // i:
                a += 1
    return a

if __name__ == '__main__':
    n = int(input())
    c = 0

    for i in range(1, n + 1):
        if i % 2 == 0:
            continue
        if count_divisor(i) == 8:
            c += 1
    print(c)
N = int(input())

result = 1
for i in range(N):
    result *= int(input())

if result > 10 ** 18:
    print('-1')
else:
    print(result)

### FIXED CODE ###

N = int(input())

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

NList.sort()
result = 1
for i in range(N):
    result *= NList[i]

    if result > 10 ** 18:
        break

if result > 10 ** 18:
    print('-1')
else:
    print(result)
from collections import defaultdict
n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]
xy.sort()
d = defaultdict(int)
for i in range(n-1):
    x1, y1 = xy[i]
    x2, y2 = xy[i+1]
    d["%d:%d" % (x2-x1, y2-y1)] += 1

print(n-max(d.values()))


### FIXED CODE ###

N=int(input())
point=[]
merge=0
for num in range(0,N):
    x,y=map(int,input().split())
    point.append([x,y])
p=0
q=0
point.sort()
ans=0
for i in range(0,N-1):
    for j in range(i+1,N):
        p=point[j][0]-point[i][0]
        q=point[j][1]-point[i][1]
        merge=0
        for k in range(0,N):
            if([point[k][0]+p,point[k][1]+q] in point):
                merge+=1
        ans=max(ans,merge)
print(N-ans)
import fractions

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

C = fractions.gcd(A, B)

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b += 1
    if n > 1:
        fct.append(n)
    return act

print(len(list(set(factorize(C))) + 1)

### FIXED CODE ###

N = int(input())

print(int(N / 2 + 0.5) / N)
A,B,C,D=map(int,input().split())
print(min(A,B) + min(C,D))

### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
D = int(input())
print(min(A,B) + min(C,D))