qyliang/CodeNanoFix huggingface dataset:
# Buggy code:
import numpy as np
X, N = list(map(int,input().split()))
if N == 0:
  input()
  print(X)
else:
  p_arr = list(map(int,input().split()))
  for i in range(101):
    if not (X in p_arr):
      print(X)
    else:
      if i == 0:
        continue
    lower = (X-i in p_arr)
    upper = (X+i in p_arr)
    if not lower:
      print(X-i)
      break
    else:
      if not upper:
        print(X+i)
        break

# Fixed code:
import numpy as np
X, N = list(map(int,input().split()))
if N == 0:
  print(X)
else:
  p_arr = list(map(int,input().split()))
  for i in range(101):
    if i == 0:
      if not (X in p_arr):
        print(X)
        break
    else:

      lower = (X-i in p_arr)
      upper = (X+i in p_arr)
      if not lower:
        print(X-i)
        break
      else:
        if not upper:
          print(X+i)
          break
# Buggy code:
x,n = list(map(int,input().split()))
if n == 0:
  print(x)
  exit()

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

import bisect
p.sort()
i = bisect.bisect_left(p,x)
print(p)
for h in range(1, p[-1]-p[0]+2):
  if p[i-h] != x-h:
    print(x-h)
    exit()
  elif p[i+h] != x+h:
    print(x+h)
    exit()    


# Fixed code:
x,n = list(map(int,input().split()))
if n == 0:
  print(x)
  exit()

p = list(map(int,input().split()))
p = [-1] + p + [102]
import bisect
p.sort()
i = bisect.bisect_left(p,x)
if p[i] != x:
    print(x)
    exit()

for h in range(102):
  if p[i-h] != x-h:
    print(x-h)
    exit()
  elif p[i+h] != x+h:
    print(x+h)
    exit()
# Buggy code:
X,N=map(int,input().split())
p=list(map(int,input().split()))
  
def abs_search(o,*l):
    if X  not in p:
        print(X)
        return
    
    for pl_num in range(X+1,102):
        if pl_num not in p:
            break
            
    for mi_num in range(X-1,-1,-1):
        if mi_num not in p:
            break
            
    abs_pl=abs(pl_num-X)
    abs_mi=abs(mi_num-X)
    
    if abs_pl<abs_mi:
        print(pl_num)
    else:
        print(mi_num)
        
abs_search(*p)

# Fixed code:
import sys
X,N=map(int,input().split())
if N==0:
    print(X)
    sys.exit()
p=list(map(int,input().split()))

def abs_search(o,*l):
    if X  not in p:
        print(X)
        return
    
    for pl_num in range(X+1,102):
        if pl_num not in p:
            break
            
    for mi_num in range(X-1,-1,-1):
        if mi_num not in p:
            break
            
    abs_pl=abs(pl_num-X)
    abs_mi=abs(mi_num-X)
    
    if abs_pl<abs_mi:
        print(pl_num)
    else:
        print(mi_num)
        
abs_search(*p)
# Buggy code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    x,n=map(int,input().split())
    P = list(map(int,input().split()))
    n_lis = [0]*102
    print(n_lis)
    for p in P:
        n_lis[p] += 1
    dis = 0
    while 1:
        if n_lis[x-dis] == 0:
            print(x-dis)
            break
        elif n_lis[x+dis] == 0:
            print(x+dis)
            break
        dis += 1

if __name__=='__main__':
    main()

# Fixed code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    x,n=map(int,input().split())
    P = list(map(int,input().split()))
    n_lis = [0]*102
    for p in P:
        n_lis[p] += 1
    dis = 0
    while 1:
        if n_lis[x-dis] == 0:
            print(x-dis)
            break
        elif n_lis[x+dis] == 0:
            print(x+dis)
            break
        dis += 1

if __name__=='__main__':
    main()
# Buggy code:
x , n = map(int , input().split())
p = list(map(int , input().split()))

ans = 0

for i in range(n):
    tmp1 = x - i
    tmp2 = x + i
    if not tmp1 in p:
        ans = tmp1
        break
    if not tmp2 in p:
        ans = tmp2
        break

print(ans)

# Fixed code:
x , n = map(int , input().split())
if n == 0:
    print(x)
    exit()
p = list(map(int , input().split()))

ans = x

for i in range(101):
    tmp1 = x - i
    tmp2 = x + i
    if not tmp1 in p:
        ans = tmp1
        break
    elif not tmp2 in p:
        ans = tmp2
        break

print(ans)
# Buggy code:

import itertools
from collections import deque,Counter
import bisect
import heapq

def IN(): return int(input())
def sIN(): return input()
def MAP(): return map(int,input().split())
def LMAP(): return list(map(int,input().split()))
def TATE(n): return [input() for i in range(n)]
MOD = 10**9 + 7

x,n = MAP()
p = LMAP()
if  n == 0:
  print(x)
  exit()
for i in range(1,200):
  a = x-i
  b = x+i
  if a not in p and b not in p and a >= 1 and b<=100:
    print(a)
    exit()
  if a not in p and b  in p and a >= 1:
    print(x-i)
    exit()
  if b not in p and a in p and b<=100:
    print(x+i)
    exit()
  
  

# Fixed code:
import itertools
from collections import deque,Counter
import bisect
import heapq

def IN(): return int(input())
def sIN(): return input()
def MAP(): return map(int,input().split())
def LMAP(): return list(map(int,input().split()))
def TATE(n): return [input() for i in range(n)]
MOD = 10**9 + 7

x,n = map(int,input().split())
if  n == 0:
  print(x)
  exit()
p = list(map(int,input().split()))

if x not in p:
  print(x)
  exit()
for i in range(1,5555555):
  a = x-i
  b = x+i
  if a not in p and b not in p:
    print(a)
    exit()
  if a not in p and b  in p:
    print(x-i)
    exit()
  if b not in p and a in p:
    print(x+i)
    exit()
# Buggy code:
X,N = map(int, input().split())
P = map(list,int(input.split()))
direction = -1
i = 0
while True:
    dist = i * direction

    if not (dist + X in P):
        print(dist + X)
        break
    i += 1
    if direction < 0: direction = 1
    else : direction = -1

# Fixed code:
X,N = map(int, input().split())
if N > 0: 
    P = list(map(int,input().split()))
    direction = -1
    i = 1
    if not X in P:
        print(X)
    else:
        while True:
            dist = i * direction
            val = dist+X
            if not (val in P):
                print(val)
                break
            if direction < 0: direction = 1
            else : 
                direction = -1
                i+=1
else: 
    print(X)
# Buggy code:
X,N = map(int,input().split(" "))
p = list(map(int,input().split(" ")))
for k in range(200):
  temp = X-k
  if temp not in p:
    print(temp)
    break
  semp = X+k
  if semp not in p:
    print(semp)
    break

# Fixed code:
X,N = map(int,input().split(" "))
if N==0:
  print(X)
else:
  p = list(map(int,input().split(" ")))
  for k in range(200):
    temp = X-k
    if temp not in p:
      print(temp)
      break
    semp = X+k
    if semp not in p:
      print(semp)
      break
# Buggy code:
x, n = list(map(int, input().split()))
if not n:
  print(x) 
else:
  l = list(map(int, input().split()))
  dic = {} 
  for ll in l: dic[l] = 1
  i = 1
  while true:
    if not dic.get(x-i,0):
      print(x-i)
      break
    elif not dic.get(x+i, 0):
      print(x+i) 
      break
    i+=1

# Fixed code:
x, n = list(map(int, input().split()))
if not n:
  print(x) 
else:
  l = list(map(int, input().split()))
  dic = {} 
  for ll in l: dic[ll] = 1
  i = 0
  while True:
    if not dic.get(x-i,0):
      print(x-i)
      break
    elif not dic.get(x+i, 0):
      print(x+i) 
      break
    i+=1
# Buggy code:
x,n = list(map(int,input().split()))
if n >0 :
  p = list(map(int,input().split()))
#print(x,n)
#print(p)
#print(max(p))
y = 100
ans = n
if n == 0:
  print(x)
else:
  for i in range(0,101):
    if i != x:
      if p.count(i) == 0:
        print('i=',i,abs(x-i))
        if abs(x-i) < y:
          ans = i
          y = abs(x-i)
  print(ans)

# Fixed code:
x,n = list(map(int,input().split()))
if n >0 :
  p = list(map(int,input().split()))
y = 101
#ans = x
if n == 0:
  print(x)
else:
  for i in range(0,102):
    #if i != x:
      if p.count(i) == 0:
        #print('i=',i,abs(x-i))
        if abs(x-i) < y:
          ans = i
          y = abs(x-i)
          #print('i=',i,'abs=',abs(x-i),'ans=',ans)
  print(ans)
# Buggy code:
X, N = map(int, input().split(' '))
if N == 0:
    print(X)
else:
    P_ls = list(map(int, input().split(' ')))
    diff, rst = -1, 0
    for i in range(101, -1, -1):
        if diff == -1:
            diff = abs(X - i)
            rst = i
        else:
            diff = min(diff, abs(X - i))
            if diff == abs(X - i):
                rst = i
    print(rst)

# Fixed code:
X, N = map(int, input().split(' '))
if N == 0:
    print(X)
else:
    P_ls = list(map(int, input().split(' ')))
    diff = -1
    for i in range(101, -1, -1):
        if i not in P_ls:
            if diff == -1:
                diff =  abs(X - i)
                rst = i
            else:
                diff = min(diff, abs(X - i))
                if diff == abs(X - i):
                    rst = i
    print(rst)
# Buggy code:
import sys
from collections import defaultdict

def ip():
    return sys.stdin.readline()


def ipl():
    return sys.stdin.readline().split()


def solve():
    x, n = map(int, ipl())
    li = list(map(int, ipl()))
    freq = defaultdict(int)
    for i in li:
        freq[i] = 1
    i, j = x, x
    while freq[i]:
        i -= 1
    while freq[j]:
        j += 1
    if abs(i - x) < abs(j - x):
        print(i)
    else:
        print(j)


if __name__ == "__main__":
    solve()

# Fixed code:
import sys
from collections import defaultdict

def ip():
    return sys.stdin.readline()


def ipl():
    return sys.stdin.readline().split()


def solve():
    x, n = map(int, ipl())
    li = list(map(int, ipl()))
    freq = defaultdict(int)
    for i in li:
        freq[i] = 1
    i, j = x, x
    while freq[i]:
        i -= 1
    while freq[j]:
        j += 1
    if abs(i - x) < abs(j - x):
        print(i)
    elif abs(i - x) == abs(j - x):
        print(min(i, j))
    else:
        print(j)


if __name__ == "__main__":
    solve()
# Buggy code:
X,N = list(map(int,input().split()))
p = list(map(int,input().split()))

def f(p):
  global X
  return p - X

p2 = list(map(f,p))

p3 = list(map(abs,p2))

OK = 2
j = 0
print(p2,p3)

if min(p3) ==0:
  while(OK==2):
    j+=1
    
    OK = p3.count(min(p3)+j)

  print(X-p2[p3.index(min(p3)+j)])
      
else:
  print(X)

# Fixed code:
X,N = list(map(int,input().split()))
if N != 0:
  p = list(map(int,input().split()))
else:
  p = [X+1]
def f(p):
  global X
  return p - X

p2 = list(map(f,p))

p3 = list(map(abs,p2))

OK = 2
j = 0


if min(p3) ==0:
  while(OK==2):
    j+=1
    OK = p3.count(min(p3)+j)
  if OK == 1:
    print(X-p2[p3.index(min(p3)+j)])
  else:
    print(X-j)
else:
  print(X)
# Buggy code:
a,b = map(int, input().split())
if b>0:
	p = list(map(int, input().split()))
else:
	print(a)
	exit()

n = a
m = a

for i in range(b):
	print(n)
	print(m)
	print("")
	if n in p:	
		n = n-1
		if n < 1:
			n = 1
	else:
		print(n)
		exit()

	if m in p:		
		m = m+1
	else:
		print(m)
		exit()


	

# Fixed code:
a,b = map(int, input().split())
if b>0:
	p = list(map(int, input().split()))
else:
	print(a)
	exit()

n = a
m = a

for i in range(b+1):
	"""
	print(n)
	print(m)
	print("")
	"""
	if n in p:	
		n = n-1			
	else:

		print(n)
		exit()

	if m in p:		
		m = m+1
	else:
		print(m)
		exit()
# Buggy code:
#!/usr/bin/env python3

def ans(P, X):
    P = set(P)
    for i in range(200):
        if X + i not in P:
            return X+i
        if X - i not in P:
            return X-i 

X, N = input().split(' ')
X = int(X)
N = int(N)
if N == 0:
    print(X)
else:
    P = input().split(' ')
    P = [int(x) for x in P]

    print(ans(P, X))

# Fixed code:
#!/usr/bin/env python3

def ans(P, X):
    P = set(P)
    for i in range(200):
        if X - i not in P:
            return X-i 
        if X + i not in P:
            return X+i

X, N = input().split(' ')
X = int(X)
N = int(N)
if N == 0:
    print(X)
else:
    P = input().split(' ')
    P = [int(x) for x in P]

    print(ans(P, X))
# Buggy code:
x, n = map(int, input().split())
not_p = []
if n != 0:
    p = list(map(int, input().split()))
    not_p = [i for i in range(201) if i not in p]
else:
    not_p = [i for i in range(201)]
print(not_p)
mn = 101
ans = 100
for i in not_p:
    d = abs(x - i)
    if mn > d:
        mn = d
        ans = i

print(ans)

# Fixed code:
x, n = map(int, input().split())
not_p = []
if n != 0:
    p = list(map(int, input().split()))
    not_p = [i for i in range(201) if i not in p]
else:
    not_p = [i for i in range(201)]

mn = 101
ans = 100
for i in not_p:
    d = abs(x - i)
    if mn > d:
        mn = d
        ans = i

print(ans)
# Buggy code:
X, N = input().split()
X = int(X)
N = int(N)

if N == 0:
    print(X)
    exit()

P = input().split()
for i in range(len(P)):
    P[i] = int(P[i])


flag_p = True
flag_n = True

abs_num = 0
abs_num_p = X + 1
abs_num_n = X - 1
while True:

    if abs_num_p in P:
        flag_p = True
    else:
        flag_p = False

    if abs_num_n in P:
        flag_n = True
    else:
        flag_n = False

    if(flag_p == True & flag_n == True):
        abs_num_p += 1
        abs_num_n -= 1
        continue;
    elif(flag_n == True & flag_p == False):
        print(abs_num_p)
        break;
    elif(flag_n == False):
        print(abs_num_n)
        break;
    abs_num_p += 1
    abs_num_n -= 1


# Fixed code:
X, N = input().split()
X = int(X)
N = int(N)

if N == 0:
    print(X)
    exit()

P = input().split()
for i in range(len(P)):
    P[i] = int(P[i])

if X not in P:
    print(X)
    exit()


abs_num_p = X + 1
abs_num_n = X - 1
while True:

    if abs_num_p in P:
        flag_p = True
    else:
        flag_p = False

    if abs_num_n in P:
        flag_n = True
    else:
        flag_n = False
    if(  flag_p == True  and flag_n == True ):
        abs_num_p += 1
        abs_num_n -= 1
        continue;
    elif(flag_p == True  and flag_n == False):
        print(abs_num_n)
        break;
    elif(flag_p == False and flag_n == True ):
        print(abs_num_p)
        break;
    elif(flag_p == False and flag_n == False):
        print(abs_num_n)
        break;

    i += 1
# Buggy code:
X,N = map(int,input().split(" "))
if N != 0:
    p_list = list(map(int,input().split(" ")))
target = X
target_num_min = X
target_num_plus = X
if X in p_list:
    while True:
        target_num_min -= 1
        if target_num_min not in p_list:
            target = target_num_min
            break
        target_num_plus += 1
        if target_num_plus not in p_list:
            target = target_num_plus
            break
print(target)

# Fixed code:
X,N = map(int,input().split(" "))
target = X
if N != 0:
    p_list = list(map(int,input().split(" ")))

    target_num_min = X
    target_num_plus = X
    if X in p_list:
        while True:
            target_num_min -= 1
            if target_num_min not in p_list:
                target = target_num_min
                break
            target_num_plus += 1
            if target_num_plus not in p_list:
                target = target_num_plus
                break
print(target)
# Buggy code:
x,n=list(map(int,input().split()))
if n==0:
  print(x)
  exit()
P=list(map(int,input().split()))
P.append(x)
PP=sorted(P)
if PP.count(x) >= 2:
  print(x)
else:
  i=PP.index(x)
  k=1
  high=None
  low=None
  while k>0:
    if PP.count(x+k)>0:
      high=x+k
    if PP.count(x-k)>0:
      low=x-k
    k-=1
    if low!=None:
      print(low)
      exit()
    elif high!=None:
      print(high)
      exit()


# Fixed code:
x,n=list(map(int,input().split()))
if n==0:
  print(x)
  exit()
P=list(map(int,input().split()))
P.append(x)
PP=sorted(P)
if PP.count(x) == 1:
  print(x)
else:
  i=PP.index(x)
  k=1
  high=x
  low=x
  while k>0:
    if PP.count(x+k)==0:
      high=x+k
    if PP.count(x-k)==0:
      low=x-k
    k+=1
    if low!=x:
      print(low)
      exit()
    elif high!=x:
      print(high)
      exit()
# Buggy code:

def main():
    x, n = map(int, input().split(" "))
    p =[]
    dif = 1e2
    ans = 0
    l_a = [i for i in range(100)]
    if n != 0:
        p = list(map(int, input().split(" ")))
    for ele in l_a[::-1]:
        if abs(x - ele) <= dif and ele not in p:
            ans = ele
            dif = abs(x - ele)
    print(ans)
if __name__ == "__main__":
    main()

# Fixed code:

def main():
    x, n = map(int, input().split(" "))
    p =[]
    dif = 1e2
    ans = 0
    l_a = [i for i in range(102)]
    if n != 0:
        p = list(map(int, input().split(" ")))
    for ele in l_a[::-1]:
        if abs(x - ele) <= dif and ele not in p:
            ans = ele
            dif = abs(x - ele)
    print(ans)
if __name__ == "__main__":
    main()
# Buggy code:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()
    MAX = A[-1]
    dp = [1] * (MAX + 5)
    ANS = 0
    for i in range(N):
        if dp[A[i]] == 0:
            continue
        for j in range(MAX):
            if i*j > MAX:
                break
            dp[i*j] = 0
        dp[A[i]] = 0
        if i < N-1 and A[i] == A[i+1]:
            continue
        ANS += 1
    print(ANS)

if __name__ == '__main__':
    main()

# Fixed code:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()
    MAX = A[-1]
    dp = [1] * (MAX + 5)
    ANS = 0
    for i in range(N):
        if dp[A[i]] == 0:
            continue
        for j in range(MAX+1):
            if A[i]*j > MAX:
                break
            dp[A[i]*j] = 0
        dp[A[i]] = 0
        if i < N-1 and A[i] == A[i+1]:
            continue
        ANS += 1
    print(ANS)

if __name__ == '__main__':
    main()
# Buggy code:
from collections import Counter

def main():
    n = int(input())
    a = sorted([int(i) for i in input().split()])
    table = [True for i in range(max(a))]
    res = 0
    amax = max(a)

    for i in a:
        if (amax ** 0.5) + 1 < i:
            break
        if table[i-1] is False:
            continue
        for j in range(i*2, amax+1, i):
            table[j-1] = False

    c = Counter(a)
    for i in set(a):
        if table[i-1]:
            if c[i] == 1:
                res += 1
    print(res)

if __name__ == '__main__':
    main()



# Fixed code:
from collections import Counter

def main():
    n = int(input())
    a = sorted([int(i) for i in input().split()])
    table = [True for i in range(max(a))]
    res = 0
    amax = max(a)

    for i in a:
        if (amax/2) + 1 < i:
            break
        if table[i-1] is False:
            continue
        for j in range(i*2, amax+1, i):
            table[j-1] = False

    c = Counter(a)
    for i in set(a):
        if table[i-1]:
            if c[i] == 1:
                res += 1
    print(res)

if __name__ == '__main__':
    main()
# Buggy code:
N = int(input())
A = list(map(int, input().split()))


def solve2(N, A):
    A = sorted(A)
    amax = A[-1]
    dp = [True] * (amax + 1)

    for i in range(len(dp)):
        x = i + 1
        if x in A:
            cnt = 2
            y = cnt * x
            while y <= amax:
                dp[y] = False
                cnt += 1
                y = cnt * x

    ansval = [x for x in A if dp[x]]

    # print(ansval)
    ans = len(ansval)

    return ans


def solve1(N, A):
    ans = 0
    for i in range(N):
        is_ans = True
        for j in range(N):
            if i != j:
                if A[i] % A[j] == 0:
                    is_ans = False
                    break

        if is_ans:
            ans += 1

    return ans


print(solve2(N, A))


# Fixed code:
N = int(input())
A = list(map(int, input().split()))


def solve2(N, A):
    A.sort()
    amax = A[-1]
    dp = [True] * (amax + 1)
    cnt = [0] * (amax + 1)

    for a in A:
        cnt[a] += 1

    for i in range(amax):
        x = i + 1
        if cnt[x] > 1:
            dp[x] = False

        if cnt[x] > 0:
            y = x * 2
            while y <= amax:
                dp[y] = False
                y += x

    ansval = [x for x in A if dp[x]]

    # print(ansval)
    ans = len(ansval)

    return ans


def solve1(N, A):
    ans = 0
    for i in range(N):
        is_ans = True
        for j in range(N):
            if i != j:
                if A[i] % A[j] == 0:
                    is_ans = False
                    break

        if is_ans:
            ans += 1

    return ans


print(solve2(N, A))
# Buggy code:
N = int(input())
A = list(map(int, input().split()))
count = 0
A.sort()
c=0
for k in range(len(A)-1):
    if A[k] == A[k+1]:
        del A[k]
        A.insert(0,0)
        c+=1
        if k <len(A)-2:
            if A[k+1] != A[k+2]:
                del A[k+1]
                A.insert(0,0)
                c+=1
del A[:c]
if len(A)>0:
    saidai = A[-1]
else:
    saidai=0
#print(A)
foo = [0 for k in range(saidai+1)]
for k in range(len(A)):
    if foo[A[k]] == 1:
        continue
    else:
        count+=1
        for j in range(A[k], saidai+1, A[k]):
            foo[j] = 1
print(count) 

# Fixed code:
N = int(input())
A = list(map(int, input().split()))
count = 0
A.sort()
c=0
"""
for k in range(len(A)-1):
    if A[k] == A[k+1]:
        del A[k]
        A.insert(0,0)
        c+=1
        if k <len(A)-2:
            if A[k+1] != A[k+2]:
                del A[k+1]
                A.insert(0,0)
                c+=1
        else:
            del A[k+1]
            A.insert(0,0)
            c+=1
del A[:c]
if len(A)>0:
    saidai = A[-1]
else:
    saidai=0
#print(A)
"""
saidai = A[-1]
foo = [0 for k in range(saidai+1)]
for k in range(len(A)):
    if foo[A[k]] == 1:
        continue
    else:
        for j in range(A[k], saidai+1, A[k]):
            foo[j] = 1
        if k < len(A)-1:
            if A[k] == A[k+1]:
                continue
        if 0 < k < len(A):
            if A[k] == A[k-1]:
                continue
        count+=1
print(count)
# Buggy code:
import sys
input = sys.stdin.readline

n = int(input())
a = [int(x) for x in input().split()]
maxval = 10 ** 6
eratosthenes = [0] * (maxval+1)

for i in range(n):
    if a[i] == 1:
        continue
    for k in range(a[i], maxval+1, a[i]):
        eratosthenes[k] += 1

result = sum(eratosthenes[v] > 1 for v in a)
print(result)

# Fixed code:
import sys
input = sys.stdin.readline

n = int(input())
a = [int(x) for x in input().split()]
maxval = 10 ** 6
factor_cnt = [0] * (maxval+1)
factor_cnt[0] = 2
for i in range(n):
    if factor_cnt[a[i]] > 1:
        continue
    for k in range(a[i], maxval+1, a[i]):
        factor_cnt[k] += 1

result = sum(factor_cnt[v] <= 1 for v in a)
print(result)
# Buggy code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
flag = [True] * (a[-1]*2)
for i, num in enumerate(a):
    if a[(i-1)%n]==num or a[(i+1)%n]==num:
        flag[num] = False
        continue
    for j in range(2, a[-1]//num+2):
        flag[j*num] = False
counter = 0
for i in a:
    if flag[i]:
        counter += 1
print(counter)

# Fixed code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
flag = [True] * (a[-1]*3)
for i, num in enumerate(a):
    if a[(i-1)%n]==num or a[(i+1)%n]==num:
        if i-1>=0 or i+1<n:
            flag[num] = False
    for j in range(2, a[-1]//num+2):
        flag[j*num] = False
counter = 0
for i in a:
    if flag[i]:
        counter += 1
print(counter)
# Buggy code:
counter = [0 for i in range(10**6+1)]
n = int(input())
a = sorted(list(map(int,input().split())))
for i in a:
  counter[i] += 1
l  = [0 for i in range(10**6+1)]
cou = 0
for i in range(n):
  b = a[i]
  if l[b]==0:
    cou += 1
    for j in range(b,10**6+1,b):
      l[j] = 1
    if counter[j]>=2:
      cou -=1
print(cou)

# Fixed code:
counter = [0 for i in range(10**6+1)]
n = int(input())
a = sorted(list(map(int,input().split())))
for i in a:
  counter[i] += 1
l  = [0 for i in range(10**6+1)]
cou = 0
for i in range(n):
  b = a[i]
  if l[b]==0:
    cou += 1
    for j in range(b,10**6+1,b):
      l[j] = 1
    if counter[b]>=2:
      cou -=1
print(cou)