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

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from collections import Counter

a = int(readline())
n = list(map(int,readline().split()))
c = Counter(n)
ss = set(n)

ans = 0
for m in ss:
  if c[m] >= 2:
    continue
  chk = set()
  t = int(m**0.5)
  for i in range(1,t+1):
      if m%i == 0:
          chk.add(i)
          chk.add(m//i)
  if chk & ss == {m}:
      ans += 1
print(ans)

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())
a = list(map(int,readline().split()))
a.sort()
if a[0] == a[-1]:
  if n > 1:
    print(0)
  else:
    print(1)
  exit()

if a[0] == 1:
  if a[0] == a[1]:
    print(0)
  else:
    print(1)
  exit()
  
def divisorize(fct):
    b, e = fct.pop()
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]

def factorize(n):
    fct = []
    b, e = 2, 0
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct
 
 
def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a
    
s = set()
if a[0] < a[1]:
  ans = 1
else:
  ans = 0
s.add(a[0])
for nm,i in enumerate(a[1:]):
  c = set()
  fct = factorize(i)
  for div in divisorize(fct):
      c.add(num(div))
  if c&s == set() and ((nm < n-2 and a[nm+2] != i) or nm == n-2):
    ans += 1
  s.add(i)

print(ans)
### BUGGY CODE ###

N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ans=0
def f(i):
  a_nex=sorted([p%(2*2**i) for p in a])
  b_nex=sorted([p%(2*2**i) for p in b])
  l=0
  p=q=r=0
  for k in reversed(a_nex):
    while p<N and b_nex[p]<2**i-k:
      p+=1
    while q<N and b_nex[q]<2*2**i-k:
      q+=1
    while r<N and b_nex[r]<3*2**i-k:
      r+=1
    l+=q-p+N-r
  return (l%2)<<i
for k in range(29):
  ans+=f(k)
print(ans)   
  


### FIXED CODE ###

N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ans=0
def f(i):
  res=0
  t=2**i
  a_nex=sorted([p%(2*t) for p in a])
  b_nex=sorted([p%(2*t) for p in b])
  l=0
  p=q=r=0
  for k in reversed(a_nex):
    while p<N and k+b_nex[p]<t:
      p+=1
    while q<N and k+b_nex[q]<2*t:
      q+=1
    while r<N and k+b_nex[r]<3*t:
      r+=1
    l+=q-p+N-r
  res=(l%2)<<i
  return res
for k in range(29):
  ans+=f(k)
print(ans)
### BUGGY CODE ###

S = input()
count=0
for i in range(len(S)):
    if S[i] =="W":
        count+=S.count("B",0,i)
print(count)

### FIXED CODE ###


S = input()
count=0
w=0
for i in range(len(S)):
    if S[i] =="W":
        count+=i-w
        w+=1
print(count)
### BUGGY CODE ###

n = int(input())
s = set()

for i in range(n):
    s ^= {input()}

print(len(s))


### FIXED CODE ###

import collections

n = int(input())
a = [int(input()) for _ in range(n)]
b = collections.Counter(a)

cnt = 0
for v in b.values():
    if v % 2 == 1:
        cnt += 1

print(cnt)
### BUGGY CODE ###

import networkx as nx
from networkx.utils.union_find import UnionFind
n,m=map(int,input().split())
a=[[i for i in input().split()] for _ in range(m)]
g=nx.Graph()
uf=UnionFind([i for i in range(n)])
for x in a:
     uf.union(x[0],x[1])
print(len(max(uf.to_sets(),key=len)))

### FIXED CODE ###

import networkx as nx
n,m=map(int,input().split())
if m==0:print(1);exit()
a=[[i for i in input().split()] for _ in range(m)]
g=nx.Graph()
for x in a:
     g.add_edge(x[0],x[1])
print(len(sorted(nx.connected_components(g),key=len,reverse=True)[0]))
### BUGGY CODE ###

#!/usr/bin/env python3

s = str(input())
k = int(input())

sets = set([])
for i in range(0, len(s)):
    for j in range(0, len(s)-i):
        sets.add(s[j:j+i+1])
print(sorted(list(sets))[k-1])

### FIXED CODE ###

#!/usr/bin/env python3
from collections import deque


def search(moji):
    num = len(moji)
    setsn = set([])
    for i in range(len(s)-num+1):
        if s[i:i+num] == moji:
            str_ = s[i:i+num+1]
            if len(str_) == num+1:
                setsn.add(str_)
    sorted_setsn = sorted(setsn, reverse=True)

    return sorted_setsn


s = str(input())
k = int(input())
n = len(s)

sets1 = set([])
for i in range(0, len(s)):
    sets1.add(s[i])

sorted_sets1 = sorted(sets1)

# if k == 1:
#     print(sorted_sets1[0])
#     exit()
# else:
#     k -= 1

dq = deque(sorted_sets1)

while(len(dq)):
    # print(dq, k)
    moji = dq.popleft()
    k -= 1
    if k == 0:
        print(moji)
        exit()
    sorted_setsn = search(moji)

    # print(sorted_setsn)
    dq.extendleft(sorted_setsn)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
import math
n,m = map(int, raw_input().split())
mod = 10**9+7
if(n==m):
    print((2*(math.factorial(n))**2)%mod)
elif(abs(n-m)==1):
    tmp = math.factorial(min(n,m))
    print((max(n,m)*(tmp**2)%mod))
else:
    print(0)

### FIXED CODE ###

# -*- coding: utf-8 -*-
def fact(x):
    f = 1
    for i in range(1,x+1):
        f *= i
        f %= 10**9+7
    return f             

n,m = map(int, raw_input().split())
mod = 10**9+7
if(n==m):
    print((2*(fact(n))**2)%mod)
elif(abs(n-m)==1):
    tmp = fact(min(n,m))
    print(max(n,m)*(tmp**2)%mod)
else:
    print(0)
### BUGGY CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for i in range(M)]
#print(N,M)
#print(A)
#print(BC)
#print("---")
A = sorted(A)
times = [bc[0] for bc in BC]
values = [bc[1] for bc in BC]
values, times = zip(*sorted(zip(values, times),reverse=True))
#print(values)
#print(times)
#values.sort(reverse=True)


for i, v in enumerate(values) :
    tmp = [n for n,i in enumerate(A) if i > v]
    if len(tmp) == N :
        break
    elif len(tmp) == 0 :
        ind = N + 1
    else :
        ind = tmp[0]

    if times[i] < ind :
        A[0:times[i]] = [v] * times[i]
    else :
        A[0:ind] = [v] * ind
    #print(A)
    A = sorted(A)
print(sum(A))


#for i, v in enumerate(values) :
#    for t in range(times[i]) :
#        min_A = min(A)
#        if v > min_A :
#            A[A.index(min(A))] = v
#            print(A)
#        else :
#            break
#    else:
#        continue
#    break
#print(sum(A))





### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for i in range(M)]
#print(N,M)
#print(A)
#print(BC)
#print("---")
A = sorted(A)
BC = sorted(BC, key = lambda x: -x[1])
D = []
for bc in BC :
    for i in range(bc[0]) :
        if len(D) < N :
            D.append(bc[1])
        else :
            break
    else :
        continue
    break
if N > len(D) :
    S = len(D)
else :
    S = N
for i in range(S) :
    if A[i] < D[i] :
        A[i] = D[i]
    else :
        break
print(sum(A))

#times = [bc[0] for bc in BC]
#values = [bc[1] for bc in BC]
#values, times = zip(*sorted(zip(values, times),reverse=True))
#print(values)
#print(times)
#values.sort(reverse=True)


# for i, v in enumerate(values) :
#     tmp = [n for n,i in enumerate(A) if i > v]
#     if len(tmp) == N :
#         break
#     elif len(tmp) == 0 :
#         ind = N + 1
#     else :
#         ind = tmp[0]
#
#     if times[i] < ind :
#         A[0:times[i]] = [v] * times[i]
#     else :
#         A[0:ind] = [v] * ind
#     #print(A)
#     A = sorted(A)
# print(sum(A))

#for i, v in enumerate(values) :
#    for t in range(times[i]) :
#        min_A = min(A)
#        if v > min_A :
#            A[A.index(min(A))] = v
#            print(A)
#        else :
#            break
#    else:
#        continue
#    break
#print(sum(A))
### BUGGY CODE ###

N, M = map(int, input().split())
maxc = M//N
while True:
    if M%maxc == 0:
        print(maxc)
        break
    maxc -=1


### FIXED CODE ###

N, M = map(int, input().split())
i = 1
ans = 0
while i*i<=M:
    if M%i != 0:
        pass
    else:
        j = M//i
        if i*N <= M:
            ans = max(ans, i)
        if j*N <= M:
            ans = max(ans, j)
    i += 1
print(ans)
### BUGGY CODE ###

from operator import itemgetter 
n,m = map(int,input().split())
list1 = []
#[input番号,県番号,年,県における順番]
for i in range(m):
    list1.append([i+1] + list(map(int,input().split())))
list1.sort(key=itemgetter(1,2))
list1[0].append(0)
for i in range(1,m):
    if list1[i-1][1] == list1[i][1]:
        list1[i].append(list1[i-1][3]+1)
    else:
        list1[i].append(0)
for i in range(m):
    list1.sort(key=itemgetter(0))

#int型
def zeropadding(s):
    padding = 6 #何桁揃えにするか入力
    return ("{0:0"+str(padding)+"d}").format(s)
    #returnはstr型なので注意！

for i in range(m):
    print(zeropadding(list1[i][1])+zeropadding(list1[i][3]+1))


### FIXED CODE ###

from copy import deepcopy as dp
from operator import itemgetter as ig
n,m = map(int,input().split())
#[input番号,県番号,年,県における順番]
list1 = []
for i in range(m):
    list1.append([i] + list(map(int,input().split())))

list2 = dp(list1)
list2.sort(key=ig(1,2))
city_number = 0
list2[0].append(city_number)
for i in range(1,m):
    if list2[i][1] == list2[i-1][1]:
        city_number += 1
        list2[i].append(city_number)
    else:
        city_number = 0
        list2[i].append(city_number)
list2.sort(key=ig(0))
for i in range(m):
    print("{0:06d}".format(list2[i][1])+"{0:06d}".format(list2[i][3]+1))
### BUGGY CODE ###

N=input()

lists = []
temp=[i for i in range(10)]

dic={0:1}

for i in N:
    new_dic={}
    hoge=list(dic.items())
    if i == "?":
        for amari,count in hoge:
            amari*=10
            for num in temp:
                a = (amari + num) % 13
                if a in new_dic:
                    new_dic[a]+=count
                else:
                    new_dic[a]=count
    else:
        num=int(i)
        for amari,count in hoge:
            a = (amari*10 + num)%13
            if a in new_dic:
                new_dic[a]+=count
            else:
                new_dic[a]=count
    dic = new_dic

try:
    print(dic[5]%(10**9 + 7))
except:
    print(0)

### FIXED CODE ###


N=input()

lists = []
temp=[i for i in range(10)]

MOD=10**9+7

dic={0:1}

for i in N:
    new_dic={}
    hoge=list(dic.items())
    if i == "?":
        for amari,count in hoge:
            amari*=10
            for num in temp:
                a = (amari + num) % 13
                if a in new_dic:
                    new_dic[a]+=count
                else:
                    new_dic[a]=count
    else:
        num=int(i)
        for amari,count in hoge:
            a = (amari*10 + num)%13
            if a in new_dic:
                new_dic[a]+=count
            else:
                new_dic[a]=count
    for key in new_dic:
        new_dic[key] %= MOD
    dic = new_dic

try:
    print(dic[5])
except:
    print(0)
### BUGGY CODE ###

n, k = map(int, input().split())
s = input()
a = []
maxLen = 0
now = ''
for i in range(n):
    decriment = 0
    if now != s[i]:
        now = s[i]
        if now == '0':
            decriment = 1
        a.append([k, i, 0])
    for j in a:
        j[0] -= decriment
        if j[0] >= 0:
            j[2] += 1
for j in a:
    maxLen = max(maxLen, j[2])
print(maxLen)

### FIXED CODE ###

n, k = map(int, input().split())
s = input()
x = None
count = 0
u = []
for c in s:
    if x != c and count > 0:
        if x == '0':
            u.append(count * -1)
        else:
            u.append(count)
        count = 0
    x = c
    count = count + 1
if x == '0':
    u.append(count * -1)
else:
    u.append(count)

x = 0
st = 0
ans = []
num = 0
for i in range(len(u)):
    if u[i] < 0:
        if x + 1 > k:
            #print("i({}), st({}), num({})".format(i, st, num))
            x = x - 1
            ans.append(num)
            while True: 
                num = num - abs(u[st])
                st = st + 1
                if u[st - 1] < 0:
                    break
        x = x + 1
    num = num + abs(u[i])
if num > 0:
    ans.append(num)
#print(ans)
print(max(ans))
### BUGGY CODE ###

S = input()
 
result = 0
while True:
    if '01' in S:
        index = S.find('01')
        S = S[:index] + S[index+2:]
        result += 2
    elif '10' in S:
        index = S.find('10')
        S = S[:index] + S[index+2:]
        result += 2
 
    else:
        break
 
print(result)

### FIXED CODE ###

S = input()
 
num_0 = S.count('0')
num_1 = S.count('1')

print(min(num_0, num_1) * 2)
### BUGGY CODE ###

# N:駅の数
# Ci:i駅から i+1 駅への移動にかかる時間(cost)
# Si:i駅の最初の発車時間(start)
# Fi:i駅の発車スパン(frequency)
# Si % Fi = 0

N = int(input())
C = [0 for i in range(N)]
S = [0 for i in range(N)]
F = [0 for i in range(N)]
C[0], S[0], F[0] = 0, 0, 0


for i in range(N-1):
    C[i+1], S[i+1], F[i+1] = (int(i) for i in input().split())

for s in range(1, N+1):
    # print("start=", s)
    if s == N:
        t = 0
        pass
    else:
        t = 0
        for i in range(s, N):
            # print("i =", i)
            # print("S[", i, "] =", S[i])
            if t < S[i]:
                t = S[i]
            for j in range(10000000):
                if t <= S[i] + j * F[i]:
                    t = S[i] + j * F[i]
                    # print("notta zikan =", t)
                    t += C[i]
                    # print("tuita zikan =", t)
                    break
    print(t)


### FIXED CODE ###

# N:駅の数
# Ci:i駅から i+1 駅への移動にかかる時間(cost)
# Si:i駅の最初の発車時間(start)
# Fi:i駅の発車スパン(frequency)
# Si % Fi = 0

N = int(input())
C = [0 for i in range(N)]
S = [0 for i in range(N)]
F = [0 for i in range(N)]
C[0], S[0], F[0] = 0, 0, 0


for i in range(N-1):
    C[i+1], S[i+1], F[i+1] = (int(i) for i in input().split())

for s in range(1, N+1):
    # print("start=", s)
    if s == N:
        t = 0
        pass
    else:
        t = 0
        for i in range(s, N):
            # print("i =", i)
            # print("S[", i, "] =", S[i])
            if t < S[i]:
                t = S[i]
            for j in range(F[i]):
                if (t + j) % F[i] == 0:
                    t = t + j
                    # print("notta zikan =", t)
                    t += C[i]
                    # print("tuita zikan =", t)
                    break
    print(t)
### BUGGY CODE ###

import heapq


def dijkstra(graph, root, goal, limit):
    # print('dijkstra',root, goal, limit)
    # print(graph)
    dist = [float('inf')] * len(graph)
    dist[root] = 0
    q = [(0, root)]
    while q:
        d, v = heapq.heappop(q)
        # print(d,v)
        if dist[v] < d:
            continue
        if d == goal:
            return dist

        limit_over = True
        for cost, target in graph[v]:
            # print(d,v, cost, target, dist)
            if dist[target] > dist[v] + cost:
                dist[target] = dist[v] + cost
                heapq.heappush(q, (dist[target], target))
                # print('heapq',q)
            if dist[v] + cost <= limit:
                limit_over = False
        if limit_over:
            # print('limit')
            return dist
    return dist

def main():
    n = int(input())
    a = [list(map(int, input().split())) for i in range(n)]

    h = []
    for i in range(n):
        for j in range(i+1, n):
            heapq.heappush(h, (a[i][j], i, j))

    graph = [[] for i in range(n)]
    total = 0
    while h:
        cost, s, t = heapq.heappop(h)
        dist = dijkstra(graph, s, t, cost)
        if dist[t] < cost:
            print(-1)
            exit()
        elif dist[t] > cost:
            total += cost
            # print(total, s, t, cost, dist[t])
            graph[s].append((cost, t))
            graph[t].append((cost, s))
            dist = dijkstra(graph, s, t, cost)

    # print(*graph, sep = '\n')
    print(total)
        
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    n = int(input())
    a = [list(map(int, input().split())) for i in range(n)]

    total = sum([sum(a[i]) for i in range(n)])
    for k in range(n):
        for i in range(n):
            if k == i:
                continue
            for j in range(n):
                if i == j or k == j:
                    continue
                if a[i][j] > a[i][k] + a[k][j]:
                    print(-1)
                    exit()
    for i in range(n):
        for j in range(n):
            for k in range(n):
                if i == k or j == k:
                    continue
                if a[i][j] == a[i][k] + a[k][j]:
                    total -= a[i][j]
                    break

    print(total//2)


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

n=int(input())
a=[0]*n
a=list(map(int,input().split()))
a=sorted(a)
ans=0
List=[]
ans+=1
flag=0
List.append(a[0])

for i in range(1,n):
    m=len(List)
    for j in range(m):
        if (a[i]==List[-1]):
            if (flag==0):
                ans-=1
            flag=1
            break
        elif (a[i]%List[j]==0):
            flag=0
            break
        elif (a[i]/List[j]<2):
            List.append(a[i])
            flag=0
            ans+=1
            break
        elif(j==m-1):
            List.append(a[i])
            flag=0
            ans+=1
            break
print(ans)

### FIXED CODE ###

n=int(input())
a=[0]*n
a=list(map(int,input().split()))
a=sorted(a)
maxnum=a[-1]
check=[True]*(maxnum+1)
before=0

for x in a:
    if (before==x):
        check[x]=False
        continue
    num=2
    while num*x<=maxnum:
        check[x*num]=False
        num+=1
    before=x

ans=0
for i in a:
    ans+=check[i]
    
print(ans)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(100000000)
def gcd(a,b): 
    if (b == 0): 
         return a 
    return gcd(b, a%b) 


mod = 10**9 + 7

n = int(input())
arr = [int(j) for j in input().split()]

prod = 1
l = 1
for x in arr:
	g = gcd(l, x)
	prod = l*x
	l = prod//g

su = 0
for x in arr:
	su += (l//x)
print(su%mod)


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)
def gcd(a,b): 
    if (b == 0): 
         return a 
    return gcd(b, a%b) 


mod = 10**9 + 7

n = int(input())
arr = [int(j) for j in input().split()]

prod = 1
l = 1
for x in arr:
	g = gcd(l, x)
	prod = l*x
	l = prod//g

su = 0
for x in arr:
	su += (l//x)
print(su%mod)
### BUGGY CODE ###

def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    l = sorted(list(map(int, input().rstrip('\n').split())))
    cnt = 0
    for i, iv in enumerate(l[:n-2]):
        for j, jv in enumerate(l[i+1:n-1]):
            t = iv + jv
            for k, kv in enumerate(l[i+j+2:n]):
                if t > kv:
                    cnt += 1
                else:
                    break
    print(cnt)


if __name__ == '__main__':
    slove()


### FIXED CODE ###

def slove():
    import sys
    import bisect
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    l = list(map(int, input().rstrip('\n').split()))
    l.sort()
    cnt = 0
    for i in range(n-2):
        for j in range(i+1, n-1):
            t = l[i] + l[j]
            p = bisect.bisect_left(l, t)
            cnt += (p - j - 1)
    print(cnt)


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

N = int(input())
abc = [chr(i) for i in range(97, 97+26)]
ss = []
ct = []
ans = 0

for i in range(N):
    s = input()
    cnt = []
    for j in abc:
        num = s.count(j)
        cnt.append(num)
    if not cnt in ss:
        ss.append(cnt)
        ct.append(1)
    else:
        ans += ct[ss.index(cnt)]
        ct[ss.index(cnt)] += 1

print(ans)


### FIXED CODE ###

N = int(input())
ss = {}
ht = []
ans = 0

for i in range(N):
    s = ''.join(sorted(input()))
    if not s in ss.keys():
        ss[s] = 1
    else:
        ans += ss[s]
        ss[s] += 1

print(ans)
### BUGGY CODE ###

text=input()
string=input()


#common_length[i]は、探索列がstring[i]で探索を終了したときに、
# string[i-common_lneght[i] + 1] 〜string[i]で構成される文字列が、探索価値を持つことを示す


len_string=len(string)
common_length=[0]*len_string
tmp=0
for i in range(1,len_string):
    if(string[i]==string[tmp]):
        if(string[i-1]==string[tmp-1]):
            common_length[i-1]=1
        else:
            common_length[i-1]=0
        tmp+=1
    else:
        common_length[i-1]=tmp
        if(string[i]==string[0]):
            tmp=1
        else:
            tmp=0

if(string[-1]==string[tmp-1]):
    common_length[-1]=tmp



tmp=0

for i in range(len(text)):
    if(text[i]!=string[tmp]):
        while(text[i]!=string[tmp] and tmp!=0):
            tmp=common_length[max([tmp-1,0])]
        if(text[i]==string[tmp]):
            tmp+=1
    else:
        tmp+=1
        if(tmp==len_string):
            print(i-tmp+1)
            tmp=common_length[-1]
    if(27<i<=26):
        print(f"{i}:{tmp}")
        


### FIXED CODE ###

text=input()
string=input()


#common_length[i]は、探索列がstring[i]で探索を終了したときに、
# string[i-common_lneght[i] + 1] 〜string[i]で構成される文字列が、探索価値を持つことを示す


len_string=len(string)
common_length=[0]*len_string
tmp=0
tmp_tmp=0
for i in range(1,len_string):
    if(string[i]==string[tmp]):
        tmp_tmp=tmp
        while(string[i]==string[tmp_tmp] and tmp_tmp >0):
            tmp_tmp=common_length[max([tmp_tmp-1,0])]
        common_length[i-1]=tmp_tmp
        tmp+=1
    else:
        common_length[i-1]=tmp
        while(string[i]!=string[tmp] and tmp>0):
            tmp=common_length[max([tmp-1,0])]

if(string[-1]==string[tmp-1]):
    common_length[-1]=tmp
common_length[0]=0


tmp=0

for i in range(len(text)):
    if(text[i]!=string[tmp]):
        while(text[i]!=string[tmp] and tmp>0):
            tmp=common_length[max([tmp-1,0])]
        if(text[i]==string[tmp]):
            tmp+=1
    else:
        tmp+=1
        if(tmp==len_string):
            print(i-tmp+1)
            tmp=common_length[-1]
### BUGGY CODE ###

n, m = map(int, input().split())
H = list(map(int, input().split()))
R = [[0]*n for _ in range(n)]
G = [1]*n 

import sys

for i in range(m):
  a, b = map(int, sys.stdin.readline().rstrip().split())
  a -= 1
  b -= 1
  if H[a]>=H[b]:
    G[b] = 0
  if H[b]>=H[a]:
    G[a] = 0
  
print(sum(G))

### FIXED CODE ###

n, m = map(int, input().split())
H = list(map(int, input().split()))
G = [1]*n 

import sys

for i in range(m):
  a, b = map(int, sys.stdin.readline().rstrip().split())
  a -= 1
  b -= 1
  if H[a]>=H[b]:
    G[b] = 0
  if H[b]>=H[a]:
    G[a] = 0
  
print(sum(G))
### BUGGY CODE ###

n,p = map(int,input().split())
s = list(map(int,list(input())))
ans = 0
cnt = [0]*p
cnt[0] = 1

if p == 2:
  for i in range(n):
    if s[i] in [0,2,4,6,8] :
      ans += i + 1
elif p == 5:
  for i in range(n):
    if s[i] in [0,5]:
      ans += i + 1
else:
  sp = [0]*n
  sp[n-1] = s[n-1]%p
  cnt[sp[n-1]] += 1
  for i in range(1,n):
    sp[n-i-1] = (sp[n-i]+s[n-i-1]*(10**i%p))%p
    cnt[sp[n-i-1]] += 1
  for j in range(p):
    cj = cnt[j]
    ans += cj * (cj-1)//2
print(ans)

### FIXED CODE ###

n,p = map(int,input().split())
s = list(map(int,list(input())))
ans = 0
cnt = [0]*p
cnt[0] = 1

if p == 2:
  for i in range(n):
    if s[i] in [0,2,4,6,8] :
      ans += i + 1
elif p == 5:
  for i in range(n):
    if s[i] in [0,5]:
      ans += i + 1
else:
  sum = 0
  for i in range(n):
    sum = (sum+s[n-i-1]*pow(10,i,p))%p
    cnt[sum] += 1
  for j in range(p):
    cj = cnt[j]
    ans += cj * (cj-1)//2
print(ans)
### BUGGY CODE ###

n=int(input())
A=sorted(list(map(int,input().split())), reverse=1)
p=0

while A:
    a=A.pop()
    if A.count(a)==0:
    	p+=1
    A=[i for i in A if i%a!=0]
    #print(A)
print(p)

### FIXED CODE ###

n=int(input())
A=sorted(list(map(int,input().split())))
B=[0]*(1+A[-1])
for i in A:
    B[i]+=1
    if B[i]==1:
        for j in range(2*i,A[-1]+1,i):
            B[j]+=1
    else:
        continue
ans=0
for i in A:
  if B[i]==1: ans+=1

print(ans)