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

# 2020-05-22
from collections import deque


def main():
    n, m, k = [int(x) for x in input().split()]
    friends = [set() for _ in range(n)]
    blocks = [set() for _ in range(n)]
    for _ in range(m):
        a, b = [int(x) - 1 for x in input().split()]
        friends[a].add(b)
        friends[b].add(a)
    for _ in range(k):
        a, b = [int(x) - 1 for x in input().split()]
        blocks[a].add(b)
        blocks[b].add(a)

    ansers = []
    ansers_append = ansers.append
    for person in range(n):
        stack = deque()
        stack_append = stack.append
        stack_pop = stack.pop
        stack_append(person)
        link = {person}
        link_add = link.add
        while stack:
            new = stack_pop()
            for adj in friends[new]:
                if adj in link:
                    continue
                stack_append(adj)
                link_add(adj)
        # 友達をたどるとブロック対象に着くことがある。積集合 &。
        ans = len(link) - len(friends[person]) - len(link & blocks[person]) - 1
        ansers_append(ans)

    return ' '.join(str(x) for x in ansers)


if __name__ == '__main__':
    print(main())


### FIXED CODE ###

# 2020-05-22
def main():
    n, m, k = [int(x) for x in input().split()]
    friends = [set() for _ in range(n)]
    blocks = [set() for _ in range(n)]
    for _ in range(m):
        a, b = [int(x) - 1 for x in input().split()]
        friends[a].add(b)
        friends[b].add(a)
    for _ in range(k):
        a, b = [int(x) - 1 for x in input().split()]
        blocks[a].add(b)
        blocks[b].add(a)

    networks = {}  # The dict of networks as sets. Keys are leaders.
    net_leaders = [-1] * n  # The leaders of the networks that the ones joined.
    visited = [False] * n
    for person in range(n):
        if visited[person]:
            continue
        network = set()
        network_add = network.add
        stack = [person]
        stack_append = stack.append
        stack_pop = stack.pop
        while stack:
            new = stack_pop()
            visited[new] = True
            net_leaders[new] = person
            network_add(new)
            for adj in friends[new]:
                if visited[adj]:
                    continue
                stack_append(adj)
        networks[person] = network

    answers = []
    answers_append = answers.append
    for person in range(n):
        net = networks[net_leaders[person]]
        ans = len(net) - len(friends[person]) - 1
        for block in blocks[person]:
            if block in net:
                ans -= 1
        answers_append(ans)

    print(*answers)
    return


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

N = int(input())
S = list(input())


min_ct = 1000000000
for i in range(N):
    ct = 0
    j = 0
    k = N-1
    while j < i:
        if ct > min_ct: break
        if S[j] == "W":
            ct += 1
        j += 1
    while k > i:
        if ct > min_ct: break
        if S[k] == "E":
            ct += 1
        k -= 1
    if min_ct > ct:
        min_ct = ct

print(min_ct)


### FIXED CODE ###

N = int(input())
S = list(input())

num_W = 0
num_E = 0
for i in range(1,N):
    if S[i] == "E":
        num_E += 1
min_ct = num_W + num_E

for i in range(1,N):
    if S[i-1] == "W":
        num_W += 1
    if S[i] == "E":
        num_E -= 1
    ct = num_W + num_E
    if min_ct > ct:
        min_ct = ct


print(min_ct)
### BUGGY CODE ###

N = int(input())
A = [int(n) for n in input().split()]

def main():
    counts = [A.count(i) for i in set(A)]
    even = [c for c in counts if c % 2 == 0]
    ans = len(counts) if len(even) % 2 == 0 else len(counts) - 1
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

N = int(input())
A = {}
for s in input().split():
    n = int(s)
    if n in A:
        A[n] += 1
    else:
        A[n] = 1

def main():
    a_len = len(A.keys())
    counts = A.values()
    even = [c for c in counts if c % 2 == 0]
    ans = a_len if len(even) % 2 == 0 else a_len - 1
    print(ans)

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

import heapq

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

for i in range(m):
    a.sort()
    a[-1] //= 2

sum = 0
for i in a:
    sum += i

print(int(sum))

### FIXED CODE ###

n, m = map(int, input().split())
aas = list(map(int, input().split()))
import heapq
hq = []
for i in aas:
    heapq.heappush(hq,-i)
for i in range(m):
    tmp = heapq.heappop(hq)
    heapq.heappush(hq,-((-tmp)//2))
print(-sum(hq))
### BUGGY CODE ###

#!/usr/bin/env python3
# atcoder 
# Türkçe konuşyorum
# Türkler var mı?
# memnün oldum
import sys
import math


sys.setrecursionlimit(10 ** 8)

#def divmin
#for i in range(d, 1, -1):
#    if(d % i == 0):
#        print(i)
def pgcd(a, b):
    while b!=0:
        a,b=b,a%b
    return a

def msum(a, b, c):
    if (a <= b) and (a <= c): 
        return math.gcd(a, math.gcd(b,c))
        #while(a >= 1):
        #    if (b % a == 0) and (c % a == 0):
        #        return a
            
    elif (b <= a) and (b <= c):
        return(math.gcd(b, math.gcd(a,c)))
    elif (c <= a) and (c <= b):
        return math.gcd(c, math.gcd(a,b))
    else:
        print("Grande érreur dans ta tête!!!")

def çözmek(num):
    csum = 0
    for i in range(1, num+1):
        for j in range(1, num+1):
            for l in range(1, num+1):
                #print(i,j,l)
                #csum += msum(i,j,l)
                csum += pgcd(i, pgcd(j,l))

    return csum


if __name__ == "__main__":
    K = int(input())
    print(çözmek(K))


### FIXED CODE ###

#!/usr/bin/env python3
# atcoder 
# Türkçe konuşyorum
# Türkler var mı?
# memnün oldum
import sys
import math


sys.setrecursionlimit(10 ** 8)

#def divmin
#for i in range(d, 1, -1):
#    if(d % i == 0):
#        print(i)
def pgcd(a, b):
    while b!=0:
        a,b=b,a%b
    return a

def msum(a, b, c):
    if (a <= b) and (a <= c): 
        return math.gcd(a, math.gcd(b,c))
        #while(a >= 1):
        #    if (b % a == 0) and (c % a == 0):
        #        return a
            
    elif (b <= a) and (b <= c):
        return(math.gcd(b, math.gcd(a,c)))
    elif (c <= a) and (c <= b):
        return math.gcd(c, math.gcd(a,b))
    else:
        print("Grande érreur dans ta tête!!!")

def çözmek(num):
    csum = 0
    for i in range(1, num+1):
        for j in range(1, num+1):
            for l in range(1, num+1):
                #print(i,j,l)
                #csum += msum(i,j,l)
                csum += math.gcd(i, math.gcd(j,l))

    return csum


if __name__ == "__main__":
    K = int(input())
    print(çözmek(K))
### BUGGY CODE ###

S = input()
while len(S) != 0:
  if S[:2] == "hi":
    S = S[2:]
print("Yes" if len(S) == 0 else "No")

### FIXED CODE ###

S = input()
while len(S) != 0:
  if S[:2] == "hi":
    S = S[2:]
  else:
    break
print("Yes" if len(S) == 0 else "No")
### BUGGY CODE ###



def dfs(graph,s):
    visited=[s]
    S=[s]
    while len(S)>0:
        v=S.pop(0)
        for w in graph[v]:
            if w not in visited:
                visited.append(w)
                S.append(w)
    return visited

if __name__ == '__main__':
    N,M=list(map(int,input().split()))
    LIST=[list(map(int,input().split())) for i in range(M)]
    adj={i+1:[] for i in range(N)}
    for l in LIST:
        x,y,z=l[0],l[1],l[2]
        if x not in adj[y]:
            adj[y].append(x)
        if y not in adj[x]:
            adj[x].append(y)
    connected=[]
    count=0

    for i in range(1,N+1):
        if i in connected:
            continue
        else:
            connected+=dfs(adj,i)
            count+=1

    print(count)


### FIXED CODE ###





class UnionFind():
    def __init__(self,n):
        self.n=n
        self.parents=[-1]*n

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

    def union(self,x,y):
        x=self.find(x)
        y=self.find(y)
        if x==y:
            return
        elif self.parents[x]>self.parents[y]:
            x,y=y,x
        self.parents[x]+=self.parents[y]
        self.parents[y]=x

    def size(self,x):
        return -self.parents[self.find(x)]

    def same(self,x,y):
        return self.find(x)==self.find(y)

    def members(self,x):
        root=self.find(x)
        return [i for i in range(self.n) if self.find(i)==root]

    def roots(self):
        return [i for i,x in enumerate(self.parents) if x<0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r:self.menbers(r) for r in self.roots()}

    def __str__(self):
        return " \n".join('{}:{}'.format(r,self.members(r)) for r in self.roots())

if __name__ == '__main__':
    N,M=list(map(int,input().split()))
    LIST=[list(map(int,input().split())) for i in range(M)]
    union_find=UnionFind(N)
    for l in LIST:
        union_find.union(l[0]-1,l[1]-1)

    print(union_find.group_count())
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
c=0
d=float("INF")
for i in range(n):
    c+=a[i]
    d=min(d,abs(sum(a)-2*c))
print(d)


### FIXED CODE ###

from itertools import accumulate as ac
n=int(input())
a=list(ac(list(map(int,input().split()))))
d=float("INF")
for i in range(n):
    d=min(d,abs(a[-1]-2*a[i]))
print(d)
### BUGGY CODE ###

X,Y,Z,K = map(int,input().split())
l_a = [int(x) for x in input().split()]
l_a.sort(reverse = True) 
l_b = [int(x) for x in input().split()]
l_b.sort(reverse = True) 
l_c = [int(x) for x in input().split()]
l_c.sort(reverse = True)  
l_d = [a + b for a in l_a for b in l_b]
l_d.sort(reverse = True)
l_d[:3000]
l_e = [ab + c for ab in l_d for c in l_c]
l_e.sort(reverse = True)
for i in range(K):
    print(l_e[i])

### FIXED CODE ###

X,Y,Z,K=map(int,input().split())
A=[int(x) for x in input().split()]
A.sort(reverse=True)
B=[int(x) for x in input().split()]
B.sort(reverse=True)
C=[int(x) for x in input().split()]
C.sort(reverse=True)
D=[a+b for a in A for b in B]
D.sort(reverse=True)
D=D[:3000]
E=[ab+c for ab in D for c in C]
E.sort(reverse=True)
for i in range(K):
  print(E[i])
### BUGGY CODE ###

from collections import Counter
import math
n,m = map(int, input().split())
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def prime_decomposition(n, table):
    N = n**(1/2)
    i = 2
    while i <= N:
        while n % i == 0:
            n /= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
table = []
prime_decomposition(m, table)
c = Counter(table).values()
cc = Counter(c)
ans = 1
N = n-1
for i,j in cc.items():
  ans *= (combinations_count(N+i,i))**j
print(ans%(10**9+7))

### FIXED CODE ###

from collections import Counter
import math
n,m = map(int, input().split())
def combinations_count(n, r):
    l = 1
    for num in range(1,r+1):
      l *= (n+num)
      l = l // num
    return l
def prime_decomposition(n, table):
    i = 2
    while i * i <= n:
        while n % i == 0:
            n /= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
table = []
prime_decomposition(m, table)
c = Counter(table).values()
cc = Counter(c)
ans = 1
N = n-1
for i,j in cc.items():
  ans *= ((combinations_count(N,i))**j)%(10**9+7)
print(ans%(10**9+7))
### BUGGY CODE ###

def expectedVal(p):
    res = 0
    for i in range(1, p+1):
        res += i / p
    # print("p:{} {}".format(p,res))
    return res

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

setP = set(P)
exDict = {}
for x in setP:
    exDict[x] = expectedVal(x)

m = n - k + 1

ans = 0
for i in range(m):
    total = 0
    # print(P[i:i+k])
    for p in P[i:i+k]:
        total += exDict[p]
    ans = max(ans, total)
    # print("i:{} ans:{}".format(i,ans))
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
p = list(map(int, input().split()))
ex_vals = [(pi+1) / 2 for pi in p]
cumsum = [0]
for i,e in enumerate(ex_vals):
    cumsum.append(cumsum[i] + e)
ans = 0
for i in range(N-K+1):
    ans = max(ans, cumsum[i+K] - cumsum[i])
print(ans)
### BUGGY CODE ###

import math
n = int(input())

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

prod = math.prod(l)
if prod > 10**18:
	print(-1)
else:
	print(prod)

### FIXED CODE ###

import math
n = int(input())
m = 10**18
l = [int(x) for x in input().split()]
l.sort();
prod = 1
for i in l:
	prod *= i
	if prod > m:
		prod = -1
		break
	elif prod == 0:
		break
print(prod)
### BUGGY CODE ###

import sys
mod = pow(10, 9) + 7
sys.setrecursionlimit(pow(10, 8))

def power(x, y):
    if   y == 0     : return 1
    elif y == 1     : return x % mod
    elif y % 2 == 0 : return power(x, y//2)**2 % mod
    else            : return power(x, (y-1)//2)**2 * x % mod
    
def mul(a, b):
    return ((a % mod) * (b % mod)) % mod

def div(a, b):
    return mul(a, power(b, mod-2))

import sys
input = sys.stdin.readline


N = int(input())

d2 = [1]
for _ in range(N):
    d2.append(2*d2[-1]%mod)

G = [[] for _ in range(N+1)]
for v in range(N-1):
    a, b = map(int, input().split())
    G[a].append(b)
    G[b].append(a)

v2i = [0 for _ in range(N+1)]
def itt(v, p):
    cn = 0
    ms = []
    for u in G[v]:
        if u == p:
            continue
        un = itt(u, v)
        ms.append(un)
        cn += un
    if p != None:
        ms.append(N-1-cn)
    v2i[v] = ms
    return cn+1
itt(1, None)
r = 0
for v in range(1, N+1):
    ff = v2i[v]
    for f in ff:
        r += d2[f] - 1 % mod
xx = d2[N]
print((div(N, 2) - div(N+r, xx))%mod)


### FIXED CODE ###

import sys
mod = pow(10, 9) + 7
sys.setrecursionlimit(pow(10, 8))

def power(x, y):
    if   y == 0     : return 1
    elif y == 1     : return x % mod
    elif y % 2 == 0 : return power(x, y//2)**2 % mod
    else            : return power(x, (y-1)//2)**2 * x % mod
    
def mul(a, b):
    return ((a % mod) * (b % mod)) % mod

def div(a, b):
    return mul(a, power(b, mod-2))

import sys
input = sys.stdin.readline


N = int(input())

d2 = [1]
inverse = [0, 1]
for _ in range(N):
    d2.append(2*d2[-1]%mod)
for i in range( 2,  10):
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )

G = [[] for _ in range(N+1)]
for v in range(N-1):
    a, b = map(int, input().split())
    G[a].append(b)
    G[b].append(a)

v2i = [0 for _ in range(N+1)]
def itt(v, p):
    cn = 0
    ms = []
    for u in G[v]:
        if u == p:
            continue
        un = itt(u, v)
        ms.append(un)
        cn += un
    if p != None:
        ms.append(N-1-cn)
    v2i[v] = ms
    return cn+1
itt(1, None)
r = 0
for v in range(1, N+1):
    ff = v2i[v]
    for f in ff:
        r += d2[f] - 1 % mod
r = N*d2[N-1]-N-r
for _ in range(N):
    r = r*500000004 % mod
print(r)
### BUGGY CODE ###

N,M=map(int,input().split())
A=list(map(int,input().split()))
BC=list(list(map(int,input().split())) for  _ in range(M))
BC.sort(key=lambda x: x[1],reverse=True)

for b,c in BC:
    A.extend([c]*b)
    if len(A)>N**2:
        break
A.sort(reverse=True)
print(sum(A[:N]))

### FIXED CODE ###

N, M = map(int,input().split())
A = list(map(int,input().split()))
BC = [list(map(int,input().split())) for _ in range(M)]
BC.sort(key = lambda x: -x[1])

for B, C in BC:
  A.extend([C]*B)
  if len(A) > N*2:
    break
A.sort(reverse = True)
print(sum(A[:N]))
### BUGGY CODE ###


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

ab = []

link = {} 

for i in range(N-1):

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

    if a-1 not in link : link[a-1] = []
    if b-1 not in link : link[b-1] = []


    link[a-1].append(b-1)
    link[b-1].append(a-1)



plus = [0] * N

for i in range(Q):

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

    plus[p-1] += x


Q = []

ans = [0] * N
end = set([])
p = [-1] * N
p[0] = 0

nowq = 0
Q.append(0)

end = end | set([0])


while nowq < N:

    nowpo = Q[nowq]
    #print (nowpo)
    ans[ nowpo ] = ans[p[ nowpo ]] + plus[nowpo]

    for i in link[nowpo]:

        if i not in end:

            Q.append(i)
            p[i] = nowpo
            #print (i,nowpo)


            end = end | set([i])


    nowq += 1

#print (Q,p,link)

for i in ans:
    print (i)


### FIXED CODE ###


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

ab = []

link = {} 

for i in range(N-1):

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

    if a-1 not in link : link[a-1] = []
    if b-1 not in link : link[b-1] = []


    link[a-1].append(b-1)
    link[b-1].append(a-1)



plus = [0] * N

for i in range(Q):

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

    plus[p-1] += x


Q = []

ans = [0] * N
end = [0] * N
p = [-1] * N
p[0] = 0

nowq = 0
Q.append(0)

end[0] = 1


while nowq < N:

    nowpo = Q[nowq]
    #print (nowpo)
    ans[ nowpo ] = ans[p[ nowpo ]] + plus[nowpo]

    for i in link[nowpo]:

        if end[i] == 0:

            Q.append(i)
            p[i] = nowpo
            #print (i,nowpo)


            end[i] = 1


    nowq += 1

#print (Q,p,link)

for i in ans:
    print (i)
### BUGGY CODE ###

K = int(input())

GCD_table = [[-1] * (K + 1) for i in [1] * (K + 1)]
#print(GCD_table)

def GCD(a: int, b: int) -> int:
    if a <= b:
        return GCD_Recursive(b, a)
    else:
        return GCD_Recursive(a, b)

def GCD_Recursive(a: int, b: int) -> int:
    if GCD_table[a][b] != -1:
        return GCD_table[a][b]

    remain = a % b
    if remain == 0:
        # print("before:", GCD_table)
        # print("a", a)
        # print("b", b)
        GCD_table[a][b] = b
        GCD_table[b][a] = b
        # print("rewrite!")
        # print("after:", GCD_table)
        return b
    else:
        # GCD_table[a][b] = GCD_Recursive(b, remain)
        # GCD_table[b][a] = GCD_Recursive(b, remain)
        if GCD_table[b][remain] != -1:
            GCD_table[a][b] = GCD_table[b][remain]
            GCD_table[b][a] = GCD_table[b][remain]
            return GCD_table[b][remain]
        else:
            return GCD(b, remain)
ans = 0

for i in range(1, K + 1):
    for j in range(1, K + 1):
        for k in range(1, K + 1):
            # print("i, j, k", i, j, k)
            # print("GCD", GCD(i, GCD(j, k)))
            ans += GCD(i, GCD(j, k))

# print(GCD_table)
print(ans)


### FIXED CODE ###

def main():
  import math
  N = int(input())
  gcd={}
  ans=0
  for i in range(1,N+1):
    for j in range(1, N+1):
      key=i*N+j
      gcd[key]=math.gcd(i,j)
  
  for k, i in gcd.items():
    for j in range(1, N+1):
      key=j*N+i
      ans+=gcd[key]
        
  print(ans)
 
if __name__=='__main__':
  main()
### BUGGY CODE ###

def main():
    s = input()
    if len(s) == 0:
        print(0)

    fix_flag = False; fix_counts = 0
    i = 0
    while True:
        if i >= len(s) - 1:
            if not fix_flag:
                print(fix_counts)
                return
            else:
                fix_flag = False
                i = 0
                continue
        if s[i] != s[i+1]:
            fix_counts += 2
            s = s[:i] + s[i+2:]
            fix_flag = True
        i += 1

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    s = input()
    if len(s) == 0:
        print(0)

    one_counter = 0
    for i in range(len(s)):
        if s[i] == '1':
            one_counter += 1
    zero_counter = len(s) - one_counter
    print(2 * min(zero_counter, one_counter))

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

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

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

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

        if x == y:
            return

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

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

N, M = map(int,input().split())
P = list(map(int,input().split()))
uf = UnionFind(N)
for i in range(M):
    a, b = map(int,input().split())
    uf.union(a-1,b-1)
A = list(uf.all_group_members().values())
a = len(A)
B =[[] for i in range(a)]
import bisect
ans = 0
for i in range(a):
    S = A[i]
    for j in range(len(S)):
        s = S[j]
        insert_index = bisect.bisect_left(B[i],P[s]-1)
        B[i].insert(insert_index,P[s]-1)
    for k in range(len(S)):
        s = S[k]
        if B[i].count(s) == 1:
            ans += 1
print(ans)

### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

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

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

        if x == y:
            return

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

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

N, M = map(int,input().split())
P = list(map(int,input().split()))
uf = UnionFind(N+1)
for i in range(M):
    a, b = map(int,input().split())
    uf.union(a,b)
ans = 0
for i in range(1,N+1):
    if uf.same(i,P[i-1]):
        ans += 1
print(ans)
### BUGGY CODE ###

import math
from collections import Counter
def ip():return int(input())
def imp():return map(int,input().split())
def impstr():return map(str,input().split())
def limp():return list(map(int,input().split()))
def limpstr():return list(map(str,input().split()))
def prime(x):
    for i in range(2,int(math.sqrt(x))+1):
        if x%i==0:return False
    return True

n=ip()
l=limp()
if 1 in l:
    if l.count(1)==1:print(1)
    else:print(0)
    exit()
else:
    #l.sort()
    c=Counter(l)
    ans=0
    for k,v in c.items():
        if v>1:continue
        else:
            f=True
            ys=[]
            for i in range(2, int(math.sqrt(k)) + 1):
                if k % i == 0 and (i in c or k//i in c):
                    f=False
                    break
            if f==True:ans+=1

    print(ans)



### FIXED CODE ###

import math
from collections import Counter
def ip():return int(input())
def imp():return map(int,input().split())
def impstr():return map(str,input().split())
def limp():return list(map(int,input().split()))
def limpstr():return list(map(str,input().split()))

n=ip()
l=limp()
if 1 in l:
    if l.count(1)==1:print(1)
    else:print(0)
    exit()
else:
    mark=[0]*(10**6+5)
    for x in l:
        if mark[x]>=1:   #X已经出现了一次
            mark[x]=2
            continue
        mark[x]=1
        i=2
        while x*i<10**6+1:
            mark[x*i]=2
            i+=1
    ans=0
    for x in l:
        if mark[x]==1:ans+=1
    print(ans)