Harryxun/stf_run huggingface dataset:
arr = list(map(int,input().split()))
A=int(arr[0])
B=int(arr[1])
H=int(arr[3])
M=int(arr[4])

kakudo_H = H*30 +M*0.5
kakudo_M = M*6
if M==0:
    kakudo_M=360

kakudo_sa=abs(kakudo_H-kakudo_M)
# cはまずは2条している値としてセット
c=A**2 +B**2-2*A*B*(math.cos(math.radians(kakudo_sa)))
C=c**0.5
print(C)

### FIXED CODE ###

import math
A,B,H,M=input().split()

A=int(A)
B=int(B)
H=int(H)
M=int(M)

kakudo_H = H*30 +M*0.5
kakudo_M = M*6
if M==0:
    kakudo_M=360

kakudo_sa=abs(kakudo_H-kakudo_M)
# cはまずは2条している値としてセット
c=A**2 +B**2-2*A*B*(math.cos(math.radians(kakudo_sa)))
C=c**0.5
print(C)
_N = int(input())
S = input()

open_parenthesis = 0
left = 0
right = 0

for s in S:
    if s == '(':
        open_parenthesis += 1
    elif s == ')':
        if open_parenthesis != 0:
            open_parenthesis -= 1
        else:
            left += 1

right = open_parenthesis

ans = '(' * left + S + ')' * right

print(ans)

### FIXED CODE ###

H, W, K = map(int, input().split())

cake = [list(input()) for _ in range(H)]
ans = [[0] * W for _ in range(H)]

id = 1
sign = 0
nothing = 0

for i in range(H):
    if cake[i].count('#') == 0:
        nothing += 1
        if i == H-1:
            for j in range(W):
                for d in range(nothing):
                    ans[i-d][j] = ans[i-nothing][j]
        continue
    for j in range(W):
        if cake[i][j] == '#':
            ans[i][sign:j+1] = [id] * (j+1-sign)
            sign = j+1
            id += 1
        elif j == W-1:
            ans[i][sign:j+1] = [id-1] * (j+1-sign)
    if nothing != 0:
        for j in range(W):
            for d in range(1,nothing+1):
                ans[i-d][j] = ans[i][j]
    sign = 0
    nothing = 0

for i in range(H):
    for j in range(W):
        print('{} '.format(ans[i][j]), end='')
    print()
D = int(input())
c = list(map(int,input().split()))
s = []
for i in range(D):
    s.append(list(map(int,input().split())))

def last(d,la):
    s = 0

    for i in range(26):
        if la[i] == 0 and  i == d:
            s += c[i] * (d - la[i]-1)
        else:
            s += c[i] * (d - la[i])
    return s

lastday = [0]*26
a = 0

for d in range(D):

    eff = s[d][0] - last(d+1,lastday)
    ret = 0
    for t in range(26):
        bef = lastday[t]
        #lastday[t] = d+1
        
        now = s[d][t] - last(d+1,lastday)
        if eff < now:
            eff = now 
            ret = t

        lastday[t] = bef
        
    lastday[ret] = d+1
    a += eff
    print(ret+1

### FIXED CODE ###

D = int(input())
c = list(map(int,input().split()))
s = []
for i in range(D):
    s.append(list(map(int,input().split())))

def last(d,la):
    s = 0

    for i in range(26):
        if la[i] == 0 and  i == d:
            s += c[i] * (d - la[i]-1)
        else:
            s += c[i] * (d - la[i])
    return s

lastday = [0]*26
a = 0

for d in range(D):

    eff = s[d][0] - last(d+1,lastday)
    ret = 0
    for t in range(26):
        bef = lastday[t]
        #lastday[t] = d+1
        
        now = s[d][t] - last(d+1,lastday)
        if eff < now:
            eff = now 
            ret = t

        lastday[t] = bef
        
    lastday[ret] = d+1
    a += eff
    print(ret+1)
S = input()
T = input()

for i in range(S):
  if S[i] != T[i]:
    T[i] = S[i]

print(S)
print(T)

### FIXED CODE ###

S = input()
T = input()
count = 0
j =0
for i in S:
  if i != T[j]:
    count +=1
  j+=1

print(count)
A, B = list(map(int, input().split()))
for i in range(1,1010):
  if int(i*8/100)==A and if int(i/10)==B:
    print(i)
    break
else:
  print(-1)

### FIXED CODE ###

import math
 
A, B = list(map(int, input().split()))
x_minA = math.ceil(100 / 8 * A)
x_minB =  10 * B
x_maxA = math.floor(100 / 8 * (A+1))
x_maxB = 10 * (B+1)
if x_minA > x_maxB or x_minB > x_maxA:
  print(-1)
else:
  for x in range(max(x_minA, x_minB), min(x_maxA, x_maxB)+1):
    if int(x * 8 / 100) == A and int(x / 10)==B:
      print(x)
      break
  else:
    print(-1)
a,b,c=map(int,input())
if 100*a+10*b+c%4==0:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

a,b,c=map(int,input().split())
if (100*a+10*b+c)%4==0:
    print('YES')
else:
    print('NO')
#!/usr/bin/env python3
import sys


def solve(N: int, M: int, s: "List[int]", c: "List[int]"):
    if len(set(s))!=len(set(c)) or N>max(set(s)):
        print(-1)
        exit()
    a=[0]*N
    for i in range(len(s)):
        a[s[i]-1]=c[i]
    #if a[0]==0:
    #    print(-1)
    #    exit()
    print("".join(map(str,a)))
    #print(s,c)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    s = [int()] * (M)  # type: "List[int]"
    c = [int()] * (M)  # type: "List[int]"
    for i in range(M):
        s[i] = int(next(tokens))
        c[i] = int(next(tokens))
    solve(N, M, s, c)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(N: int, M: int, s: "List[int]", c: "List[int]"):
    sc=[]
    for i in range(M):
        sc.append([s[i],c[i]])
    sc=list(map(list,set(map(tuple,sc))))
    sc.sort()
    for i in range(len(sc)):
        if sc[i][0]==1 and sc[i][1]==0 and not N==1:
            print(-1)
            exit()
    if M==0 and N==1:
        print(0)
        exit()
    if M==0 or len(sc)==1 and c[0]==0 and not s[0]==1:
        q=[1]
        for i in range(N-1):
            q.append(0)
        print("".join(map(str,q)))
        exit()
    for i in range(len(sc)-1):
        if sc[i][0]==sc[i+1][0]:
            print(-1)
            exit()
    #if N>max(set(s)):
    #    print(-1)
    #    exit()
    a=[0]*N
    for i in range(len(s)):
        a[s[i]-1]=c[i]
    if a[0]==0 and not N==1:
        a[0]=1
    print("".join(map(str,a)))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    s = [int()] * (M)  # type: "List[int]"
    c = [int()] * (M)  # type: "List[int]"
    for i in range(M):
        s[i] = int(next(tokens))
        c[i] = int(next(tokens))
    solve(N, M, s, c)

if __name__ == '__main__':
    main()
N, x = map(int, input().split())
list_a = [int(x) for x in input().split()]

list_a.sort()
total = sum(list_a)
if x < list_a[0] :
    print(0)
    exit()
if x > total :
    print(ans-1)
    exit()
ans = 0

for i in range(N) :
    if list_a[i] <= x :
        x -= list_a[i]
        ans += 1

print(ans)


### FIXED CODE ###

N, x = map(int, input().split())
list_a = [int(x) for x in input().split()]

list_a.sort()
total = sum(list_a)
if x < list_a[0] :
    print(0)
    exit()
if x > total :
    print(len(list_a)-1)
    exit()
ans = 0

for i in range(N) :
    if list_a[i] <= x :
        x -= list_a[i]
        ans += 1

print(ans)
h, w=map(int, input().split())
if h==1 or w==1:
  print(1)
else:
  ans=(h*w)///2
  if h*w%2==1:
    print(ans+1)
  else:
    print(ans)

### FIXED CODE ###

h, w=map(int, input().split())
if h==1 or w==1:
  print(1)
else:
  ans=(h*w)//2
  if h*w%2==1:
    print(ans+1)
  else:
    print(ans)
num=int(input())
strs=input().split()
for i in range(num):
  strs[1].insert(i,strs[0][i])
print(strs[1])

### FIXED CODE ###

num=int(input())
strs=input().split()
text=""
for i in range(num):
  text+=strs[0][i]
  text+=strs[1][i]
print(text)
n=int(input('enter number'))
def doublefactorial(n): 
    if (n == 0 or n == 1): 
        return 1; 
    return n * doublefactorial(n - 2);

def trailing_zeros(longint):
    manipulandum = str(longint)
    return len(manipulandum)-len(manipulandum.rstrip('0'))
  
print("Double factorial is",  
       doublefactorial(n));

print('trailing zeroes are'+ str(trailing_zeros(doublefactorial(n))))

### FIXED CODE ###

def fun(n):
    if n%2!=0:
        return 0
    else:
        ans=0
        n//=2
        while(n):
            ans=ans+n//5
            n=n//5
    return ans


n = int(input())
if n>=2:
    print(fun(n))
else:
    print(0)
l = [int(input()) for i in range(5)]
l_0 = [a%10 for a in l]
ar = []
for n in l_0:
  if n != 0:
    ar.append(10-n)
  else:
    ar.append(0)
s = l_0.index(max(l_0))
l.pop(s)
l_0.pop(s)
ans = sum(l) + sum(l_0) + l[s]
print(ans)
l = [int(input()) for i in range(5)]
l_0 = [a%10 for a in l]
ar = []
for n in l_0:
  if n != 0:
    ar.append(10-n)
  else:
    ar.append(0)
s = ar.index(max(ar))
ar.pop(s)
ans = sum(l) + sum(ar)
print(ans)


### FIXED CODE ###

input_list = [int(input()) for i in range(5)]
k = int(input())
if input_list[4] - input_list[0] <= k:
  print('Yay!')
else:
  print(':(')
def ext_gcd(m, a):
  #require a, m be relative prime
  #m > a  
  if m < a:
    assert ('error')
  elif a == 0:
    return 1, 0
  else:
    x1, y1 = ext_gcd(a, m%a)
    y = x1 - y1 * int(m/a)
    x = y1
    return x, y

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

n = (-1/3)*x + (2/3)*y
m = (-1/3)*y + (2/3)*x

if n != int(n) or m != int(m) or n<0 or m<0:
  ans = 0
else:
   n = int(n)
   m = int(m)
   if n < m :
      m = c
      m = n
      n = c
   # (n+m!)/(n!)(m!) mod (1e9+7)
   ans = 1
   prime = 1000000007 
   for i in range(n+1,m+n+1):
        ans = int(ans * i) 
        ans = (ans % prime)
   for i in range(1, m+1):
      ori_inv = int(ext_gcd(prime, i)[1])
      while ori_inv < 0 :
        ori_inv += prime
      assert int(ori_inv * i) % prime == 1
      ans = int(ans * ori_inv)  
      ans = (ans % prime)
print(ans)

### FIXED CODE ###

def ext_gcd(p, a):
  #require a, m be relative prime
  #m > a  
  if a == 0:
    return 1, 0
  else:
    x1, y1 = ext_gcd(a, p%a)
    y = x1 - y1 * int(p/a)
    x = y1
    return x, y

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

n = (2 * y - x)/3
m = (2 * x - y)/3

if n != int(n) or m != int(m) or n<0 or m<0:
  ans = 0
else:
   n = int(n)
   m = int(m)
   if n < m :
      c = m
      m = n
      n = c
   # (n+m!)/(n!)(m!) mod (1e9+7)
   ans = 1
   prime = 1000000007 
   for i in range(n+1,m+n+1):
        ans = int(ans * i) 
        ans = (ans % prime)
   for i in range(1, m+1):
      ori_inv = int(ext_gcd(prime, i)[1])
      while ori_inv < 0 :
        ori_inv += prime
      ans = int(ans * ori_inv)  
      ans = (ans % prime)
print(ans)
s,w =int(input())
if w>=s:
  print('UNSAFE')
else:
  print("SAFE")
  

### FIXED CODE ###

#A
s,w = map(int,input().split())
if w>=s :
    print('unsafe')
else :
    print('safe')
n=input()
a=input()
if n<500 and a>=n:
  print("Yes")
elif n>=500 and n%500<a:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n=int(input())
a=int(input())
if  n%500<=a:
  print("Yes")
else:
  print("No")
a, b, c = map(int, raw_input().split())
if a < b and b < c:
   return "Yes"
else:
   return "NO"

### FIXED CODE ###

a, b, c = map(int, raw_input().split())
if a < b < c:
    print "Yes"
else:
    print "No"
import sys
import numpy as np
read = sys.stdin.read

N, W, *wv = map(int, read().split())
dp = np.zeros((W + 1, N + 1), np.int64)
idx = 1

for w, v in zip(*[iter(wv)] * 2):
    dp[:, idx] = dp[:, idx - 1]
    dp[w:, idx] = np.maximum(dp[w:, idx], dp[:W - w + 1, idx] + v)
    idx += 1

print(dp[-1, -1])

### FIXED CODE ###

import sys
from itertools import accumulate, product
from operator import itemgetter
read = sys.stdin.read

N, W, *wv = map(int, read().split())
w1 = wv[0]
V = [[0] for _ in range(4)]

for w, v in sorted(zip(*[iter(wv)] * 2), key=itemgetter(1), reverse=True):
    V[w - w1].append(v)


V = list(map(list, map(accumulate, V)))
n = [len(V[i]) for i in range(4)]
answer = 0
for a, b, c, d in product(range(n[0]), range(n[1]), range(n[2]), range(n[3])):
    if b + c * 2 + d * 3 + (a + b + c + d) * w1 > W:
        continue

    v = V[0][a] + V[1][b] + V[2][c] + V[3][d]
    if v > answer:
        answer = v

print(answer)
from collections import deque
H, W = map(int, input().split())
Field = [list(input()) for i in range(H)]

que = deque()
que.append([0, 0])
Field[0][0] = 0

while que:
    now = que.popleft()
    if now == [H-1, W-1]:
        break

    if now[0]+1 <= H -1:
        if Field[now[0]+1][now[1]] == ".":
            Field[now[0]+1][now[1]] = str(int(Field[now[0]][now[1]])+1)
            que.append([now[0]+1, now[1]])

    if now[0]-1 >= 0:
        if Field[now[0]-1][now[1]] == ".":
            Field[now[0]-1][now[1]] = str(int(Field[now[0]][now[1]])+1)
            que.append([now[0]-1, now[1]])

    if now[1] + 1 <= W -1:
        if Field[now[0]][now[1]+1] == ".":
            Field[now[0]][now[1]+1] = str(int(Field[now[0]][now[1]])+1)
            que.append([now[0], now[1]+1])

    if now[1] -1 >= 0:
        if Field[now[0]][now[1]-1] == ".":
            Field[now[0]][now[1]-1] = str(int(Field[now[0]][now[1]])+1)
            que.append([now[0], now[1]-1])

Z = int(Field[H-1][W-1])

sharp_cnt = 0
for f in Field:
    sharp_cnt += f.count("#")

print(H*W - sharp_cnt - Z - 1)


### FIXED CODE ###

from collections import deque
H, W = map(int, input().split())
Field = [list(input()) for i in range(H)]

que = deque()
que.append([0, 0])
Field[0][0] = 0

while que:
    now = que.popleft()
    if now == [H-1, W-1]:
        break

    if now[0]+1 <= H -1:
        if Field[now[0]+1][now[1]] == ".":
            Field[now[0]+1][now[1]] = str(int(Field[now[0]][now[1]])+1)
            que.append([now[0]+1, now[1]])

    if now[0]-1 >= 0:
        if Field[now[0]-1][now[1]] == ".":
            Field[now[0]-1][now[1]] = str(int(Field[now[0]][now[1]])+1)
            que.append([now[0]-1, now[1]])

    if now[1] + 1 <= W -1:
        if Field[now[0]][now[1]+1] == ".":
            Field[now[0]][now[1]+1] = str(int(Field[now[0]][now[1]])+1)
            que.append([now[0], now[1]+1])

    if now[1] -1 >= 0:
        if Field[now[0]][now[1]-1] == ".":
            Field[now[0]][now[1]-1] = str(int(Field[now[0]][now[1]])+1)
            que.append([now[0], now[1]-1])
else:
    print(-1)
    exit()
Z = int(Field[H-1][W-1])

sharp_cnt = 0
for f in Field:
    sharp_cnt += f.count("#")

print(H*W - sharp_cnt - Z - 1)
print(100000-int(input().split())%1000)


### FIXED CODE ###

print((100000-int(input()))%1000)
def read_input():
    l_1 = input()
    day = int(l_1.split(" ")[0])

    num_cake = [int(i) for i in input().split(" ")]

    return day, num_cake

def get_max_index(target_list):
    return [i for i, j in enumerate(target_list) if j == max(target_list)]


def get_second_max_index(target_list):
    return [i for i, j in enumerate(target_list) if j == list(sorted(set(target_list), reverse=True))[1]]


def mog(day, num_cake):
    """

    >>> mog(7, [3,2,2])
    0
    >>> mog(6, [1,4,1])
    1
    >>> mog(100, [100])
    99
    """
    printed = False
    previous_index = -1

    for i in range(0, day):
        # print("num_cake: ", num_cake)
        # print("previous_index: ",previous_index)
        ate_flag = False
        mog_maybe_index = get_max_index(num_cake)
        # print("mog_maybe_index: {0}".format(mog_maybe_index))
        for n in mog_maybe_index:
            if n == previous_index:
                continue
            else:
                num_cake[n] = num_cake[n] - 1
                ate_flag = True
                previous_index = n
                break
        if ate_flag is False:
            try:
                mog_ext = get_second_max_index(num_cake)
                # print("mog_ext", mog_ext)
                if num_cake[mog_ext[0]] == 0:
                    printed = True
                    print(max(num_cake))
                    break
            except IndexError:
                print(max(num_cake))
                printed = True
                break
            num_cake[mog_ext[0]] = num_cake[mog_ext[0]] - 1
            previous_index = mog_ext[0]

    if printed is False:
        print(0)



if __name__ == "__main__":
    #import doctest
    #doctest.testmod()

    day, num_cake = read_input()
    mog(day, num_cake)


### FIXED CODE ###

def read_input():
    return input()

def checker(inp_str):
    flag = 0
    for i in list(inp_str):
        if flag == 0:
            if i == "C":
                flag = 1
        if flag == 1:
            if i == "F":
                flag = 2

    if flag == 2:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    checker(read_input())
# coding: utf-8

N, S, K = map(int,input().split())
if S == 10**9:
    A = [S-1] * (N-K) + [S] * K
else:
    A = [S+1] * (N-K) + [S] * K

print(A)

### FIXED CODE ###

# coding: utf-8
# Your code here!
N,K,S=map(int,input().split())
ans=[]
p=N-K

if S!=10**9:
    for i in range(N-K):
        ans.append(str(S+1))
    for i in range(K):
        ans.append(str(S))
else:
    for i in range(N-K):
        ans.append(str(1))
    for i in range(K):
        ans.append(str(S))
#print(ans)
#ans=' '.join(ans)

#print(len(ans))


#print(" ".join([str(n) for n in ans]))
print(*ans)
inf=100000000

def calc(uth,dis,c):
    fare=0
    if dis>=inf:
        return inf
    if unchin[c]==1:
        return uth[c][1][0]*dis
    ddis=uth[c][0]
    dcost=uth[c][1]
    i=1
    while(i<unchin[c] and dis>ddis[i]):
        fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
        i+=1
    fare+=(dis-ddis[i-1])*dcost[i-1]
    return fare

def floyd(bigmap,n):
    res=bigmap
    for k in range(1,n+1):
        for i in range(1,n+1):
            for j in range(1,n+1):
                if res[i][j]>res[i][k]+res[k][j]:
                    res[i][j]=res[i][k]+res[k][j]
    return res

def init2d(bigmap,n):
    for i in range(n+1):
        bigmap.append([])
    for map1 in bigmap:
        for j in range(n+1):
            map1.append(inf)
    for i in range(1,n+1):
        bigmap[i][i]=0
    return bigmap

while(1):
    n,m,c,s,g=map(int,input().split())
    if(n==m==0): break
    for i in range(m):
        x,y,d,c0=map(int,input().split())

    unchin=list(map(int,input().split()))
    unchin.insert(0,0)
    uth=[]
    uth.append([])
    for i in range(1,c+1):
        ddis=list(map(int,input().split()))
        ddis.insert(0,0)
        dcost=list(map(int,input().split()))
        uth.append([ddis,dcost])
	
	print(-1)

### FIXED CODE ###

inf=100000000

def calc(uth,dis,c):
    fare=0
    if dis>=inf:
        return inf
    if unchin[c]==1:
        return uth[c][1][0]*dis
    ddis=uth[c][0]
    dcost=uth[c][1]
    i=1
    while(i<unchin[c] and dis>ddis[i]):
        fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
        i+=1
    fare+=(dis-ddis[i-1])*dcost[i-1]
    return fare

def floyd(bigmap,n):
    res=bigmap
    for k in range(1,n+1):
        for i in range(1,n+1):
            for j in range(1,n+1):
                if res[i][j]>res[i][k]+res[k][j]:
                    res[i][j]=res[i][k]+res[k][j]
    return res

def init2d(bigmap,n):
    for i in range(n+1):
        bigmap.append([])
    for map1 in bigmap:
        for j in range(n+1):
            map1.append(inf)
    for i in range(1,n+1):
        bigmap[i][i]=0
    return bigmap

while(1):
    n,m,c,s,g=map(int,raw_input().split())
    if(n==m==0): break
    rosen=[]
    for i in range(c+1):
        map0=[]
        rosen.append(init2d(map0,n))

    for i in range(m):
        x,y,d,c0=map(int,raw_input().split())
        rosen[c0][x][y]=min(rosen[c0][x][y],d)
        rosen[c0][y][x]=min(rosen[c0][x][y],d)

    unchin=list(map(int,raw_input().split()))
    unchin.insert(0,0)
    uth=[]
    uth.append([])
    for i in range(1,c+1):
        ddis=list(map(int,raw_input().split()))
        ddis.insert(0,0)
        dcost=list(map(int,raw_input().split()))
        uth.append([ddis,dcost])

    bigmap=[]
    bigmap=init2d(bigmap,n)


    for c0,cmap in enumerate(rosen[1:]):
        tmp=floyd(cmap,n)
        for i in range(1,n+1):
            for j in range(1,n+1):
                bigmap[i][j]=min(bigmap[i][j],calc(uth,tmp[i][j],c0+1))

    bigmap=floyd(bigmap,n)

    ans=bigmap[s][g]
    if ans < inf:
        print(ans)
    else:
        print(-1)
import numpy as np

num_q = int(input())
x = 0
f = 0
a = []
c = False

for i in range(num_q):
  q = input()
  if q[0] == '2':
    print(x, f)
  else:
    _, n, m = map(int, q.split(" "))
    a.append(n)
    a.sort()
    x_tmp = a[(i+1)//2]
    if c:
      f += m + np.abs(x - n)
    else:
      f += m + np.abs(x_tmp - n)
    c = ~c
    x = x_tmp


### FIXED CODE ###

from heapq import heappush, heappop

num_q = int(input())
x = 0
f = 0
low = []
high = []
odd = False
num_a = 0
 
for _ in range(num_q):
  q = input()
  if q[0] == '2':
    print(x, f)
  else:
    _, n, m = map(int, q.split(" "))
    if odd:
      if n >= -low[0]:
        f += m + n + low[0]
        heappush(high, n)
      else:
        f += m - n - low[0]
        heappush(low, -n)
        heappush(high, -heappop(low))
    else:
      f += m
      if num_a == 0:
        heappush(low, -n)
      else:
        if n > -low[0]:
          if n > high[0]:
            f += n - high[0]
          heappush(high, n)
          heappush(low, -heappop(high))
        else:
          f += - n - low[0]
          heappush(low, -n)

    odd = ~odd
    x = -low[0]
    num_a += 1
a,b=map(int,input().split())
if a+b==15:
    print('+')
elif a*b=15:
    print('*')
else:
    print('x')

### FIXED CODE ###

a,b=map(int,input().split())
if a+b==15:
    print('+')
elif a*b==15:
    print('*')
else:
    print('x')
#import sys
input = sys.stdin.readline
#n = int(input())
#l = list(map(int, input().split()))
'''
a=[]
b=[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)
    b.append(B)'''

def yakusuu(n):
    #約数リスト生成,バラバラに出るので.sort()を使う必要あるかも
    #PyPy推奨
    yakusuu_list = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            yakusuu_list.append(i)
            if i != n // i:
                yakusuu_list.append(n//i)
    return yakusuu_list

def ok(wa,waaa,item,bl):
    m=yakusuu(item)
    #print(m)
    if waaa[item-1]==True:
        bl.append(item-1)
        return

    waaa[item-1]=True

    for jtem in m:
        if jtem!=item and waaa[jtem-1]==True:
            bl.append(item-1)
            return

    waaa[item-1]=True
    #print(item,waaa[:25])
    return

def main():
    n=int(input())
    a=list(map(int, input().split()))
    #print(sorted(a))
    a.sort()
    wa=[a[0]]
    waaa=[False]*(a[-1])
    bl=[]

    for item in a:
        ok(wa,waaa,item,bl)

    #import collections
    print(waaa.count(True)-len(set(bl)))
    return
    #print(max(0,len(wa)-len(set(bl))))

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline

#n = int(input())
#l = list(map(int, input().split()))

'''
a=[]
b=[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)   
    b.append(B)'''
def cal(n,li):
    lis=[True]*(n+1)
    for item in li:
        if lis[item]:
            for i in range(item*2,n+1,item):
                lis[i]=False
    return lis
from collections import Counter

n=int(input())
a=list(map(int,input().split()))
a.sort()
l=cal(a[-1],a)
ll=Counter(a)
#print(l,ll)
ans=0
for i in range(n):
    if ll[a[i]]==1:
        if l[a[i]]:
            ans+=1

print(ans)