Harryxun/stf_run huggingface dataset:
n = int(input())
ab = [list(map(int, input().split())) for _ in range(n - 1)]

from collections import defaultdict
g = defaultdict(list)
for i in range(len(ab)):
    g[ab[i][0]].append(ab[i][1])
    g[ab[i][1]].append(ab[i][0])

k = 0
for key in g.keys():
    k = max(k, len(g[key]))
print(k)

from bisect import bisect_left

ans_d = dict()
for key in g.keys():
    ans_d[key] = [0] * len(g[key])

used_all = dict()
for key in g.keys():
    used_all[key] = []

for key in g.keys():
    used = used_all[key]

    unused = []
    for j in range(1, k+1):
        idx = bisect_left(used, j)
        if idx < len(used) and used[idx] == j:
            continue
        else:
            unused.append(j)
    # print(unused)

    idx = 0
    for j in range(len(g[key])):
        if ans_d[key][j] == 0:
            ans_d[key][j] = unused[idx]

            target = g[key][j]
            idx2 = bisect_left(g[target], key)
            ans_d[target][idx2] = unused[idx]
            used_all[key].append(unused[idx])
            used_all[target].append(unused[idx])
            idx += 1

# print(ans_d)

for i in range(len(ab)):
    idx = bisect_left(g[ab[i][0]], ab[i][1])
    print(ans_d[ab[i][0]][idx])


### FIXED CODE ###

n = int(input())
ab = [list(map(int, input().split())) for _ in range(n - 1)]

from collections import defaultdict
g = defaultdict(list)
for a, b in ab:
    a -= 1
    b -= 1
    g[a].append(b)
    g[b].append(a)

k = 0
for key in g:
    k = max(k, len(g[key]))
print(k)

ans = dict()
q = [(0, -1)] # (pos, used_color)
visited = set([0])
while q:
    cur, col = q.pop()

    if col == 0:
        tmp = 1
    else:
        tmp = 0

    for target in g[cur]:
        if target not in visited:
            q.append((target, tmp))
            visited.add(target)
            ans[(cur, target)] = tmp

            if tmp + 1 == col:
                tmp += 2
            else:
                tmp += 1

for a, b in ab:
    key = (a-1, b-1)
    print(ans[key] + 1)
a, b, c, x, y = list(map(int, input().split()))

if a<c and b<c:
    ans = a*x + b*y
else:
    min_money=5000*10**5
    for nc in range(0,2*max(x,y)+1,2):
        if nc > 2*x and nc > 2*y:
            break
        if nc > 2*x:
            money = (y-nc//2)*b + nc*c
        elif nc > 2*y:
            money = (x-nc//2)*a + nc*c
        else:
            money = (x-nc//2)*a + (y-nc//2)*b + nc*c
        if min_money > money:
            min_money = money
            nc0=nc

print(min_money)

### FIXED CODE ###

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

min_money=2*5000*10**5
for nc in range(0,2*10**5+1,2):
    if nc > 2*x and nc > 2*y:
        break
    if nc > 2*x:
        money = (y-nc//2)*b + nc*c
    elif nc > 2*y:
        money = (x-nc//2)*a + nc*c
    else:
        money = (x-nc//2)*a + (y-nc//2)*b + nc*c
    if min_money > money:
        min_money = money
            
print(min_money)
#N = raw_input()
#A_list = map(int, raw_input().split())
#B_list = map(int, raw_input().split())
if sum(A_list) < sum(B_list):
    print(-1)
else:
    import numpy as np
    diff = [x - y for (x, y) in zip(A_list, B_list)]
    neg_list = [i for i in diff if i < 0]
    neg_sum = sum(neg_list)
    pos_list = [i for i in diff if i > 0]
    pos_list.sort(reverse=True)
    pos_list = np.cumsum(pos_list).tolist()
    for j,k in enumerate(pos_list):
        if len(neg_list) == 0:
            print(0)
            break
        elif neg_sum + k >= 0:
            print(j+1+len(neg_list))
            break 
        else:
            continue

### FIXED CODE ###

N = raw_input()
A_list = map(int, raw_input().split())
B_list = map(int, raw_input().split())
if sum(A_list) < sum(B_list):
    print(-1)
else:
    import numpy as np
    diff = [x - y for (x, y) in zip(A_list, B_list)]
    neg_list = [i for i in diff if i < 0]
    neg_sum = sum(neg_list)
    pos_list = [i for i in diff if i > 0]
    pos_list.sort(reverse=True)
    pos_list = np.cumsum(pos_list).tolist()
    for j,k in enumerate(pos_list):
        if len(neg_list) == 0:
            print(0)
            break
        elif neg_sum + k >= 0:
            print(j+1+len(neg_list))
            break 
        else:
            continue
deff main():
    N, M = map(int, input().split())
    if N >= M:
        print(0)
        exit()
    X = [j for j in map(int, input().split())]
    X.sort()
    s = max(X)-min(X)
    d = [X[i+1]-X[i] for i in range(M-1)]
    d.sort()

    print(s-sum(d[-N+1:]))

main()


### FIXED CODE ###

def main():
    N, M = map(int, input().split())
    X = [j for j in map(int, input().split())]
    if N >= M:
        print(0)
        exit()
    X.sort()
    s = max(X)-min(X)
    d = [X[i+1]-X[i] for i in range(M-1)]
    d.sort()
    if N == 1:
        print(s)
    else:
        print(s-sum(d[-N+1:]))


main()
s=int(input())
 
if s[0] == 1:
    print(1)
elif s[1] == 1:
    print(1)
elif s[2] == 1:
    print(1)
else:
    print(0)
s.count(1)

### FIXED CODE ###

s = input()
count = 0 
if s[0] == '1':
    count += 1
if s[1] == '1':
    count += 1
if s[2] == '1':
    count += 1
print(count)
from operator import itemgetter

N = int(input())


A = []
for i in range(N - 1):
    A.append([int(i) for i in input().split()])

B = []
for row in A:
    B.append(sorted(row))
B.sort(key = itemgetter(0))

link_list = [[] for i in range(N)]
for row in B:
    link_list[row[0] - 1].append(row[1] - 1)
    link_list[row[1] - 1].append(row[0] - 1)
edge_color = dict()
marker = [0] * N

def DFS_color(node, pre_color):
    target_list = link_list[node]
    color = 1
    for ko_node in target_list:
        if marker[ko_node] == 0:
            if pre_color == color:
                color += 1
            edge_color[node, ko_node] = color
            edge_color[ko_node, node] = color 
            marker[ko_node] = 1
            DFS_color(ko_node, color)
            color += 1
        else:
            pass

marker[0] = 1
DFS_color(0, 0)

print(max(edge_color.values()))
for node1, node2 in A:
    print(edge_color[node1 - 1, node2 - 1])

### FIXED CODE ###

from operator import itemgetter
import sys
sys.setrecursionlimit(10**7)

N = int(input())


A = []
for i in range(N - 1):
    A.append([int(i)-1 for i in input().split()])

B = []
for row in A:
    B.append(sorted(row))
B.sort(key = itemgetter(0))

link_list = [[] for i in range(N)]
for row in B:
    link_list[row[0]].append(row[1])
    link_list[row[1]].append(row[0])
edge_color = dict()
marker = [0] * N


def DFS_color(node, pre_color):
    target_list = link_list[node]
    color = 1
    for ko_node in target_list:
        if marker[ko_node] == 0:
            if pre_color == color:
                color += 1
            edge_color[node, ko_node] = color
            edge_color[ko_node, node] = color 
            marker[ko_node] = 1
            DFS_color(ko_node, color)
            color += 1
        else:
            pass

marker[0] = 1
DFS_color(0, 0)

print(max(edge_color.values()))
for node1, node2 in A:
    print(edge_color[node1, node2])
import bisect
a,b=map(int,input().split())
c=list(map(int,input().split()))

if a not in c:
    print(a)
    exit()

n=[i for i in range(-1,101)]

m=sorted(list(set(n)^set(c)))
bisect.insort_right(m,a)

m=sorted(list(set(m)))
if len(m)<=3:
    print(m[m.index(a)-1])

elif b==0:
    print(a)

elif a==100:
    print(m[m.index(a)+1])

elif abs(a-m[m.index(a)-1])<abs(a-m[m.index(a)+1]):
    print(m[m.index(a)-1])

elif abs(a-m[m.index(a)-1])==abs(a-m[m.index(a)+1]):
    print(m[m.index(a)-1])

else:
    print(m[m.index(a)+1])

### FIXED CODE ###

a,b=map(int,input().split())
c=list(map(int,input().split()))
ans=0
for i in range(100):
    if a-i not in c:
        ans=a-i
        break
    elif a+i not in c:
        ans=a+i
        break
print(ans)
# abc123_a.py
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

l=[a,b,c,d,e]
size=len(l)
for i in range(size):
 for j in range(i,size):
  if i == j:
   continue
  if (l[j]-l[i]) > k:
   print(":(")
   exit(-1)

print("Yay!")


### FIXED CODE ###

# abc123_a.py
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

l=[]
# l=[a,b,c,d,e]
l.append(a)
l.append(b)
l.append(c)
l.append(d)
l.append(e)

size=len(l)
for i in range(size):
 for j in range(i,size):
  if i == j:
   continue
  if (l[j]-l[i]) > k:
   print(":(")
   exit()

print("Yay!")
import sys
line = sys.stdin.readline().strip()
n, z, w = map(int, line.split()[:3])
line = sys.stdin.readline().strip()
a = list(map(int, line.split()[:n]))
#print(n, z, w)
#print(a)

def think_x(z, w, a, turn):
    if len(a) == 0:
        return abs(z - w)
    result = 0
    result_i = None
    for i in range(len(a)):
        r = think_y(a[i], w, a[i+1:], turn + 1)
        if r >= result:
            result = r
            result_i = i
    #print("# X", turn, result_i, result)
    return result

def think_y(z, w, a, turn):
    if len(a) == 0:
        return abs(z - w)
    result = 9999999999999999999999
    result_i = None
    for i in range(len(a)):
        r = think_x(z, a[i], a[i+1:], turn + 1)
        if r <= result:
            result = r
            result_i = i
    #print("# Y", turn, result_i, result)
    return result

print(think_x(z, w, a, 1))


### FIXED CODE ###

import sys
line = sys.stdin.readline().strip()
n, z, w = map(int, line.split()[:3])
line = sys.stdin.readline().strip()
a = list(map(int, line.split()[:n]))
#print(n, z, w)
#print(a)

if n > 2:
  result = max(
    abs(a[-1] - w),
    abs(a[-2] - a[-1])
  )
else:
  result = abs(a[-1] - w)

print(result)
S = list(S)
print('yes' if len(set(S)) == len(S) else 'no')

### FIXED CODE ###

S = list(input())
print('yes' if len(set(S)) == len(S) else 'no')
import sys
n = int(input())
A = list(map(int, sys.stdin))

cnt = 0
def insertion_sort(L, n, g):
    global cnt
    for i in range(g, n):
        v = L[i]
        j = i - g
        while 0 <= j and v < L[j]:
            L[j+g] = L[j]
            j -= g
            cnt += 1
        L[j+g] = v


def shell_sort(L, n):
    global G
    for i in G:
        insertion_sort(L, n, i)

#G = [i for i in [262913, 65921, 16577, 4193, 1073, 281, 77, 23, 8, 1] if i <= n]
g = []
for i in range(100):
    x = pow(4, i)
    if n < x:
        break
    else:
        g.append(x)

G = reversed(g)
shell_sort(A, n)

print(len(G))
print(' '.join(str(x) for x in G))
print(cnt)
for i in A:
    print(i)

### FIXED CODE ###

import sys
n = int(input())
A = list(map(int, sys.stdin))

cnt = 0
def insertion_sort(L, n, g):
    global cnt
    for i in range(g, n):
        v = L[i]
        j = i - g
        while 0 <= j and v < L[j]:
            L[j+g] = L[j]
            j -= g
            cnt += 1
        L[j+g] = v


def shell_sort(L, n):
    global G
    for i in G:
        insertion_sort(L, n, i)

G = [i for i in [262913, 65921, 16577, 4193, 1073, 281, 77, 23, 8, 1] if i <= n]
shell_sort(A, n)

print(len(G))
print(' '.join(str(x) for x in G))
print(cnt)
for i in A:
    print(i)
S=input()
T=input()
ans=0
for i in range(3):
	if S[i] == T[i]:
  	ans += 1
    print(ans)

### FIXED CODE ###

a = input()
b = input()
c = 0
for i in range(3):
  if a[i] == b[i]:
    c += 1
print(c)
s = input()
t = input()
cnt = 1
for _ in range(len(s)):
    a = s[len(s)-1]
    b = [s[i] for i in range(len(s)-1)]
    bb = "".join(b)
    s = a+bb
    if s == t:
        cnt *= 0

print("No") if cnt else print("Yes")

### FIXED CODE ###

data = sorted(list(map(int, input().split())))

print(data[2] - data[0])
# -*- config: utf-8 -*-
 
 
 
while(1):
    a,b,c = map(int,raw_input().split())
    j = 0
 
 
    if a + b == c or a + c == b or b + c== a:
        j=1
 
    if(j == 1):
        print 'Yes'
    else:
        print 'No'
 
 
 

### FIXED CODE ###

# -*- config: utf-8 -*-
 
 
 
 
a,b,c = map(int,raw_input().split())
j = 0
 
 
if a + b == c or a + c == b or b + c== a:
    j=1
 
if(j == 1):
    print 'Yes'
else:
    print 'No'
# from fractions import gcd
from math import gcd
from functools import reduce
N, M = map(int, input().split())
nums = set([num // 2 for num in list(map(int, input().split()))])
# 1<=X<=Mの範囲で、半公倍数の数を求める。
# 但し、Xは、num*(p+0.5)でなければならない
# Mが10**9なので、全部やるのは無理。
# n.5倍なので、numsのあたいは全て偶数になっている。

# nums一つ一つ、答えになりうるXの配列を作って、重複したものを残せばそれが答えになる。
# Nが10**5なので、どうだろう


def half_multiple(x, y):
    return (x * y) // gcd(x, y)


def main():
    half_multiple_num = reduce(half_multiple, nums, 1)

    # print(half_multiple_num)
    for num in nums:
        if (half_multiple_num // num) % 2 == 0:
            print(0)
            return

    pmax = M // half_multiple_num
    pmax = pmax - 1 if pmax % 2 == 0 else pmax

    print((pmax + 1) // 2)


main()


### FIXED CODE ###

from fractions import gcd
# from math import gcd
from functools import reduce
N, M = map(int, input().split())
nums = set([num // 2 for num in list(map(int, input().split()))])
# 1<=X<=Mの範囲で、半公倍数の数を求める。
# 但し、Xは、num*(p+0.5)でなければならない
# Mが10**9なので、全部やるのは無理。
# n.5倍なので、numsのあたいは全て偶数になっている。

# nums一つ一つ、答えになりうるXの配列を作って、重複したものを残せばそれが答えになる。
# Nが10**5なので、どうだろう


def half_multiple(x, y):
    return (x * y) // gcd(x, y)


def run():
    half_multiple_num = reduce(half_multiple, nums, 1)

    # print(half_multiple_num)
    for num in nums:
        if (half_multiple_num // num) % 2 == 0:
            print(0)
            return

    pmax = M // half_multiple_num
    pmax = pmax - 1 if pmax % 2 == 0 else pmax

    print((pmax + 1) // 2)


run()
if 1 <= A <= 9  1 <= B <= 9
  print(A*B)
else:
  print("-1")


### FIXED CODE ###

A,B=map(int,input().split())
if 1<=A<=9 and 1<=B<=9:
  print(A*B)
else:
  print("-1")
import sys, math
from functools import lru_cache
from collections import defaultdict
sys.setrecursionlimit(500000)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def main():
    N = ii()
    D = list(mi())
    ans = 1

    if D[0] != 0:
        print(0)
        return

    dic = defaultdict(int)
    for i in range(N):
        dic[D[i]] += 1

    for k, v in dic.items():
        if k == 0:
            continue
        ans *= pow(dic[k-1], v, 998244353)

    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys, math
from functools import lru_cache
from collections import defaultdict
sys.setrecursionlimit(500000)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def main():
    N = ii()
    D = list(mi())
    ans = 1

    if D[0] != 0:
        print(0)
        return

    dic = defaultdict(int)
    for i in range(N):
        dic[D[i]] += 1

    for i in range(1, N):
        ans *= dic[D[i]-1]
        ans %= 998244353

    print(ans)

if __name__ == '__main__':
    main()
from collections in deque

N = int(input())

A = deque()

for i in range(N):
	b= input()
	if b == "deleteFirst":
		A.popleft()
	elif b == "deleteLast":
		A.pop()
	else:
		b, c = b.split()
		c = int(c)
	
		if b == "insert":
			A.appendleft(c)
		elif b == "delete":
			if (c in A):
				A.remove(c)

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

### FIXED CODE ###

from collections import deque

N = int(input())

A = deque()

for i in range(N):
	b= input()
	if b == "deleteFirst":
		A.popleft()
	elif b == "deleteLast":
		A.pop()
	else:
		b, c = b.split()
		c = int(c)
	
		if b == "insert":
			A.appendleft(c)
		elif b == "delete":
			if (c in A):
				A.remove(c)

print(" ".join(map(str, A)))
n,m = list(map(int,input().split()))
s = []
c = []
for i in range(m):
    ss,cc = list(map(int,input().split()))
    s.append(ss -1 )
    c.append(cc)

ans = [-1] * n
flag = True
for i in range(m):
    if ans[s[i]] == -1 :
        ans[s[i]] = c[i]
    elif ans[s[i]] != c[i]:
        flag = False

if n !=1 and  ans[0] == 0:
    flag = False

if flag :
    ans = [ str(a) if a != -1 else "0" for a in ans ]
    if n != 1 and ans[0] == "0":
        ans[0] = 1
    print("".join(ans))
else:
    print(-1) 



### FIXED CODE ###

n,m = list(map(int,input().split()))
s = []
c = []
for i in range(m):
    ss,cc = list(map(int,input().split()))
    s.append(ss -1 )
    c.append(cc)

ans = [-1] * n
flag = True
for i in range(m):
    if ans[s[i]] == -1 :
        ans[s[i]] = c[i]
    elif ans[s[i]] != c[i]:
        flag = False

if n !=1 and  ans[0] == 0:
    flag = False

if flag :
    ans = [ str(a) if a != -1 else "0" for a in ans ]
    if n != 1 and ans[0] == "0":
        ans[0] = "1"
    print("".join(ans))
else:
    print(-1)
def solve(N, Y):
    for x in range(N + 1):
        for y in range(0, N - x + 1):
            z = N - x - y
            elif 10000 * x + 5000 * y + 1000 * z == Y:
                return x, y, z
    return -1, -1, -1
 
 
N, Y = list(map(int, input().split()))
x, y, z = solve(N, Y)
print('{} {} {}'.format(x, y, z))

### FIXED CODE ###

def solve(N, Y):
    for x in range(N+1):
        for y in range(N+1):
            z = N - x - y
            if z < 0:
                continue
            elif 10000 * x + 5000 * y + 1000 * z == Y:
                return x, y, z
    return -1, -1, -1

N, Y = list(map(int, input().split()))
x, y, z = solve(N, Y)
print('{} {} {}'.format(x, y, z))
a=input()
s=input()

if a>=3200:
    print(s)

if a<3200:
    print('red')

### FIXED CODE ###

a=int(input())
s=input()

if a>=3200:
    print(s)

else:
    print('red')
def main():
  s=list(input())
  n=len(s)
  dp=[0]*13
  mod=pow(10,9)+7
  if s[-1]=='?':
    dp=[1]*10+[0]*3
  else:
    dp[int(s[-1])]=1
  p_dp=[0]*13
  for i in range(2,n+1):
    if s[-i]=='?':
      for j in range(10):
        a=(j*pow(10,i-1,13))%13
        for k in range(13):
          p_dp[(a+k)%13]+=dp[k]
    else:
      j=int(s[-i])
      a=(j*pow(10,i-1,13))%13
      for k in range(13):
        p_dp[(a+k)%13]+=dp[k]
    
    for k in range(13):
      p_dp[k]%=mod
    dp=p_dp.copy()
    p_dp=[0]*13
  print(dp[5])

if __name__=='__main__':
  main()


### FIXED CODE ###

def main():
  s=list(input())
  n=len(s)
  dp=[0]*13
  mod=pow(10,9)+7
  if s[-1]=='?':
    dp=[1]*10+[0]*3
  else:
    dp[int(s[-1])]=1
  p_dp=[0]*13
  for i in range(2,n+1):
    if s[-i]=='?':
      for j in range(10):
        a=(j*pow(10,i-1,13))%13
        for k in range(13):
          p_dp[(a+k)%13]+=dp[k]
    else:
      j=int(s[-i])
      a=(j*pow(10,i-1,13))%13
      for k in range(13):
        p_dp[(a+k)%13]+=dp[k]
    
    for k in range(13):
      p_dp[k]%=mod
    dp=[k for k in p_dp]
    p_dp=[0]*13
  print(dp[5])

if __name__=='__main__':
  #import datetime
  #print(datetime.datetime.now())
  main()
  #print(datetime.datetime.now())
N,M=map(int,input().split())

a=list(map(int,input().split()))
a=sorted(a)
a.append(0)
D=[]
for i in range(M):

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

    D.append(d)

D.sort(key=lambda x:x[1])


k=0

for j in range(M):
    l=k
    for i in range(D[M-j-1][0]):

        if D[M-j-1][1] > a[k]:
            a[k]=D[M-j-1][1]
            k=k+1

    if l==k:
        break

print(sum(a)-a[N])

### FIXED CODE ###

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

a=list(map(int,input().split()))
a=sorted(a)
a.append(0)
D=[]
for i in range(M):

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

    D.append(d)

D.sort(key=lambda x:x[1])


k=0

for j in range(M):
    l=k
    for i in range(D[M-j-1][0]):
        q=max(M-j-1,0)
        if D[q][1] > a[k] and k!=N:
            a[k]=D[q][1]
            k=k+1
        else:
            k=k

        if l==k:
            break

    if l==k:
        break



print(sum(a)-a[N])
from collections import defaultdict
def inpl(): return [int(i) for i in input().split()]

path = defaultdict(lambda: [])
N = int(input())
for _ in range(N-1):
    a, b, c = inpl()
    path[a].append((b,c))
    path[b].append((a,c))

ctr = 1
Q, K = inpl()
now = [K]
dist = [0 for _ in range(N+1)]
while True:
    for na in now.copy():
        na = now.pop()
        for nb, nc in path[na]:
            dist[nb] = dist[na] + nc
            path[nb].remove((na,nc))
            now.add(nb)
            ctr += 1
    if ctr >=  N:
        break
for i in range(Q):
    x, y = inpl()
    print(dist[x]+dist[y])

### FIXED CODE ###

from collections import defaultdict
def inpl(): return [int(i) for i in input().split()]

path = defaultdict(lambda: [])
N = int(input())
for _ in range(N-1):
    a, b, c = inpl()
    path[a].append((b,c))
    path[b].append((a,c))

ctr = 1
Q, K = inpl()
now = [K]
dist = [0 for _ in range(N+1)]
while True:
    for na in now.copy():
        na = now.pop()
        for nb, nc in path[na]:
            dist[nb] = dist[na] + nc
            path[nb].remove((na,nc))
            now.append(nb)
            ctr += 1
    if ctr >=  N:
        break
for i in range(Q):
    x, y = inpl()
    print(dist[x]+dist[y])
numbers=input().split(" ")
a=numbers[0]
b=numbers[1]
c=a*b
if c%2==0:
  print("Even")
else:
  print("Odd")

### FIXED CODE ###

numbers = input().split(" ")
a= int(numbers[0])
b= int(numbers[1])
c=a*b
if c%2==0:
  print("Even")
else:
  print("Odd")
n=int(input())
A=sorted(map(int,input().split()))
L=[A[0]]

c=0
if A[0]!=A[1]:
    c=1
for i in range(n-1):
    flag=0
    for l in L:
        if A[i+1]%l==0:
            flag=1
            break
    if flag==0:
        L.append(A[i+1])
        c+=1
print(c)

### FIXED CODE ###

from collections import defaultdict
n=int(input())
A=sorted((map(int,input().split())))
maxA=max(A)
L=[0]*(maxA+1)
AD=defaultdict(int)
for a in A:
	L[a]=1
	AD[a]+=1
for a in A:
	if AD[a]>=2:
		L[a]=0
	for i in range(2*a,maxA+1,a):
		L[i]=0
print(sum(L))
n = input()
a = list(map(int(i) for i in input().split()) 
 
counter = 0
while sum(list(map(lambda x: x % 2, a))) == 0:
	a = list(map(lambda x: x / 2, a))
  	counter += 1
 
prrint(counter)

### FIXED CODE ###

n = input()
a = list(map(int, input().split()))
 
counter = 0
while sum(list(map(lambda x: x % 2, a))) == 0:
    a = list(map(lambda x: x / 2, a))
    counter += 1
 
print(counter)
a, b, c = map(int, input().split())
print("YES" if b - a == c - b else "NO")


### FIXED CODE ###

print("ABC"+input())
n=int(input())
a=list(map(int,input().split()))
b=list(set(a))   
if len(b)==1:
    print(b[0])
    exit()
else: 
    x=1
    while x>0:
        c=sorted(b)
        c[1]=c[1]-c[0]
        c=sorted(list(set(c)))
        if c[0]==1:
            x=0
        if len(c)==1:
            print(2):
            exit()
print(1)
            
    



### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=list(set(a))   
if len(b)==1:
    print(b[0])
    exit()
else:
    c=sorted(b)
    x=1
    while x>0:
        v=c[0]
        for i in range(len(c)):
            if i!=0:
                c[i]=c[i]%v
        while 0 in c:
            c.remove(0)
        c=sorted(list(set(c)))
        if len(c)==1:
            print(c[0])
            exit()
        if c[0]==1:
            x=0
print(1)