Harryxun/stf_run huggingface dataset:
s = input()
x, y = map(int, input().split())

mv = [len(e) for e in s.split("T")]
mv_x = mv[2::2]
mv_y = mv[1::2]


def solve_dp(li, start, end):
    l = len(li)
    mx = sum(li)

    left = start - mx
    right = start + mx

    if end > right or end < left:
        return 0

    dp = [[0] * (2 * mx + 1) for _ in range(l + 1)]
    dp[0][start] = 1
    for i, e in enumerate(li, 1):
        for j in range(left, right + 1):
            if left <= j - e <= right:
                dp[i][j] |= dp[i-1][j-e]
            if left <= j + e <= right:
                dp[i][j] |= dp[i-1][j+e]

    return 0#dp[l][end]


bl_x = solve_dp(mv_x, mv[0], x)
bl_y = solve_dp(mv_y, 0, y)

if bl_x and bl_y:
    ans = "Yes"
else:
    ans = "No"

print(ans)


### FIXED CODE ###

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

mv = [len(e) for e in s.split("T")]
mv_x = mv[2::2]
mv_y = mv[1::2]


def solve_dp(li, start, end):
    l = len(li)
    mx = sum(li)

    if l == 0:
        return start == end

    left = start - mx
    right = start + mx

    if end > right or end < left:
        return 0

    dp = [[0] * (2 * mx + 1) for _ in range(l + 1)]
    dp[0][start] = 1
    for i, e in enumerate(li, 1):
        for j in range(left, right + 1):
            if left <= j - e <= right:
                dp[i][j] |= dp[i-1][j-e]
            if left <= j + e <= right:
                dp[i][j] |= dp[i-1][j+e]

    return dp[l][end]


bl_x = solve_dp(mv_x, mv[0], x)
bl_y = solve_dp(mv_y, 0, y)

if bl_x and bl_y:
    ans = "Yes"
else:
    ans = "No"

print(ans)
N,M=map(int,input().split())
s=[0]*M
c=[0]*M
a=0
for i in range(M):
	s[i],c[i]=map(int,input().split())
ans=-1
if M==0:
	ans=1*(10**(N-1))
	print(ans)
if max(s)>N:
	print(ans)
	exit()
for j in range(0,1000):
	value=str(j)
	if len(value)==N:
		for S,C in zip(s,c):
			if int(value[S-1])==C:
				a+=1
		if a==M:
			ans=int(j)
			break
		else:
			a=0
	else:
		continue
print(ans)

### FIXED CODE ###

N,M=map(int,input().split())
s=[0]*M
c=[0]*M
a=0
for i in range(M):
	s[i],c[i]=map(int,input().split())
ans=-1
if M==0:
	ans=1*(10**(N-1))
	if ans==1:
		ans=0
	print(ans)
	exit()
if max(s)>N:
	print(ans)
	exit()
for j in range(0,1000):
	value=str(j)
	if len(value)==N:
		for S,C in zip(s,c):
			if int(value[S-1])==C:
				a+=1
		if a==M:
			ans=int(j)
			break
		else:
			a=0
	else:
		continue
print(ans)
import sys
import copy
input = sys.stdin.readline

S=input()
L=len(S)

goukei=0
for i in range(L):
    goukei+=int(S[i])

if goukei%9==0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

S=input()
L=len(S)

goukei=0
for i in range(L):
    goukei+=int(S[i])

if goukei%9==0:
    print("Yes")
else:
    print("No")
a, b = map(int, input(),split())

r = a * b % 2

if r == 0:
  print('Even')
else:
  print('Odd')

### FIXED CODE ###

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

r = a * b % 2

if r == 0:
  print('Even')
else:
  print('Odd')
from collections import deque
h, w = map(int, input().split())
chiz = [[] for _ in range(w)]
cnt = 0
for _ in range(h):
    tmp_list = input()
    for i in range(w):
        if tmp_list[i]=='.':
            cnt += 1
        chiz[i].append(tmp_list[i])
dq = deque([(0,0)])
chiz[0][0] = 0
while dq:
    i,j = dq.popleft()
    for e in [(1,0),(-1,0),(0,-1),(0,1)]:
        if i+e[0]>=0 and i+e[0]<w and j+e[1]>=0 and j+e[1]<h:
            if chiz[i+e[0]][j+e[1]] == '.':
                chiz[i+e[0]][j+e[1]] = chiz[i][j] + 1
                dq.append((i+e[0],j+e[1]))
print(cnt-chiz[w-1][h-1]-1)

### FIXED CODE ###

from collections import deque
h, w = map(int, input().split())
chiz = [[] for _ in range(w)]
cnt = 0
for _ in range(h):
    tmp_list = input()
    for i in range(w):
        if tmp_list[i]=='.':
            cnt += 1
        chiz[i].append(tmp_list[i])
dq = deque([(0,0)])
chiz[0][0] = 0
while dq:
    i,j = dq.popleft()
    for e in [(1,0),(-1,0),(0,-1),(0,1)]:
        if i+e[0]>=0 and i+e[0]<w and j+e[1]>=0 and j+e[1]<h:
            if chiz[i+e[0]][j+e[1]] == '.':
                chiz[i+e[0]][j+e[1]] = chiz[i][j] + 1
                dq.append((i+e[0],j+e[1]))
try:
    print(cnt-chiz[w-1][h-1]-1)
except:
    print(-1)
import math
a, b, x = map(int, input().split())
h = x / (a * a)
if h == b / 2:
    answer = math.atan(a / b)
elif h < b / 2:
    answer = math.atan(2*h*a / (b * b))
else:
    answer = math.atan(a / (2 * (b - h)))
print(90 - answer / math.pi * 180)

### FIXED CODE ###

import math
a, b, x = map(int, input().split())
h = x / (a * a)
if h == b / 2:
    answer = math.atan(a / b)
elif h < b / 2:
    answer = math.atan(2*h*a / (b * b))
else:
    if h == b:
        answer = math.pi / 2
    else:
        answer = math.atan(a / (2 * (b - h)))
print(90 - answer / math.pi * 180)
from operator import add, mul, sub, or_


class BIT:
    def __init__(self, n, op, ie):
        self.n = n
        self.tree = [ie]*(n+1)
        self.op = op

    def update(self, i, v):
        while i <= self.n:
            self.tree[i] = self.op(self.tree[i], v)
            i += i & -i

    def query(self, i):
        v = self.ie
        while i:
            v = self.op(self.tree[i], v)
            i -= i & -i
        return v


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

q = [[] for _ in range(N+1)]
for i in range(Q):
    x, y = map(int, input().split())
    q[y-1].append([i, x-1])

bit = BIT(N, add, 0)
finds = [-1]*(N+1)
ans = [0]*Q
for i in range(N):
    if finds[c[i]] != -1:
        bit.update(finds[c[i]]+1, -1)

    finds[c[i]] = i
    bit.update(finds[c[i]]+1, 1)

    for j, x in q[i]:
        ans[j] = bit.query(i+1) - bit.query(x)

for a in ans:
    print(a)


### FIXED CODE ###

from operator import add, mul, sub, or_


class SegmentTree:
    '''
    セグメント木(遅延ではない)
    1-indexd セグメント木
    values : 値の配列
    op : 区間に対する関数
    ie : 初期値
    '''

    def __init__(self, values):
        self.values = values
        vlen = len(values)
        self.size = 2 ** (vlen-1).bit_length()
        self.tree = [0]*self.size + self.values + [0]*(self.size-vlen)

        for i in range(self.size-1, 0, -1):
            self.tree[i] = self.tree[i*2] + self.tree[i*2+1]

    def update(self, i, v):
        i += self.size
        self.tree[i] = v
        while i > 0:
            i //= 2
            self.tree[i] = self.tree[i*2] + self.tree[i*2+1]

    def query(self, l, r):
        l += self.size
        r += self.size
        ret = 0
        while l < r:
            if l & 1:
                ret += self.tree[l]
                l += 1
            if r & 1:
                r -= 1
                ret += self.tree[r]
            l //= 2
            r //= 2
        return ret


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

q = [[] for _ in range(N+1)]
for i in range(Q):
    x, y = map(int, input().split())
    q[y-1].append([i, x-1])

st = SegmentTree([0]*(N+1))
finds = [-1]*(N+1)
ans = [0]*Q
for i in range(N):
    if finds[c[i]] != -1:
        st.update(finds[c[i]], 0)

    finds[c[i]] = i
    st.update(finds[c[i]], 1)

    for j, x in q[i]:
        ans[j] = st.query(x, i+1)

for a in ans:
    print(a)
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

print(min(a),max(a),sum(a))

### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]
print(min(a),max(a),sum(a))
n=int(input())
a=list(map(int(input().split())))
b=list(map(int(input().split())))
c=list(map(int(input().split())))
p=0
for i in range(n):
  p+=b[a[i]]
  if　a[i]-a[i-1]==1:
    p+=c[i]
print(p)
  


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
p=0
for i in range(n):
  p+=b[a[i]-1]
  if i>=1 and a[i]-a[i-1]==1:
    p+=c[a[i-1]-1]
print(p)
a, b, c = map(int, input().split())
print("Yes" if a+b=c or b+c=a or c+a=b else "No")

### FIXED CODE ###

a, b, c = map(int, input().split())
print("Yes" if a+b==c or b+c==a or c+a==b else "No")
N, M= map(int, input().split())
zahyo = []
for i in map(int,input().split()):
    zahyo += [i]
sum=0
#マージソート用関数
# merge(p, q): あらかじめソートされた配列 p と q をまとめる。
def merge(p,q):
    result=[]
    i,j=0,0
    #p[i]とq[j]を比べて小さい方をresultに加える。
    while i<len(p) and j<len(q):
        #.appendで加える。小さかった方の数字を一つ進める。
        #これで小さいものから順にresultに加えることができる。
        if p[i] <= q[j]:
            result.append(p[i])
            i+=1
        else:
            result.append(q[j])
            j+=1

    #片方の配列が全て比較済みとなると、そこで上のwhile分は終了してしまう
    #なのでまだ比較していない要素が残っている配列をそのままresultに連結する
    #これは.extendを使う。まだ比較していない要素はスライスで簡単に分けることができる。
    if i<len(p):
        result.extend(p[i:])
    if j<len(q):
        result.extend(q[j:])
    #resultを返して終了
    return result

# mergesort(a): 配列 a をマージソートしたものを返す。
def mergesort(a):
    #要素が一つになるまで分割したらそれ自体を返す。
    if len(a)==1:
        return a
    #最初の半分を切り取ってソート
    p=mergesort(a[:len(a)//2])
    #残りの半分を切り取ってソート
    q=mergesort(a[len(a)//2:])
    #merge関数で連結させる
    return merge(p,q)

zahyo = mergesort(zahyo)
gap = []
for i in range(M-1):
    gap += [zahyo[i+1]-zahyo[i]] 
gap = mergesort(gap)
if N >= M:
    print(0)
else:
    for i in gap[:M-N]:
        sum += i
    print(sum)

### FIXED CODE ###

N, M= map(int, input().split())
zahyo = []
for i in map(int,input().split()):
    zahyo += [i]
sum=0
#マージソート用関数
# merge(p, q): あらかじめソートされた配列 p と q をまとめる。
def merge(p,q):
    result=[]
    i,j=0,0
    #p[i]とq[j]を比べて小さい方をresultに加える。
    while i<len(p) and j<len(q):
        #.appendで加える。小さかった方の数字を一つ進める。
        #これで小さいものから順にresultに加えることができる。
        if p[i] <= q[j]:
            result.append(p[i])
            i+=1
        else:
            result.append(q[j])
            j+=1

    #片方の配列が全て比較済みとなると、そこで上のwhile分は終了してしまう
    #なのでまだ比較していない要素が残っている配列をそのままresultに連結する
    #これは.extendを使う。まだ比較していない要素はスライスで簡単に分けることができる。
    if i<len(p):
        result.extend(p[i:])
    if j<len(q):
        result.extend(q[j:])
    #resultを返して終了
    return result

# mergesort(a): 配列 a をマージソートしたものを返す。
def mergesort(a):
    #要素が一つになるまで分割したらそれ自体を返す。
    if len(a)==1:
        return a
    #最初の半分を切り取ってソート
    p=mergesort(a[:len(a)//2])
    #残りの半分を切り取ってソート
    q=mergesort(a[len(a)//2:])
    #merge関数で連結させる
    return merge(p,q)

if M==1:
    print(0)
else:
    zahyo = mergesort(zahyo)
    gap = []
    for i in range(M-1):
        gap += [zahyo[i+1]-zahyo[i]] 
    gap = mergesort(gap)
    if N >= M:
        print(0)
    else:
        for i in gap[:M-N]:
            sum += i
        print(sum)
import math
A,B = (int(i) for i in input().split())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N = math.gcd(A,B)
N_divisors = make_divisors(N)
prime_nums = []
for i in range(1,len(N_divisors)):
  if i == 1:
    prime_nums.append(N_divisors[i])
  else:
    for j in range(1,i):
      if N_divisors[i]%N_divisors[j] == 0:
        break
      if j == i-1:
        prime_nums.append(N_divisors[i])

ans = 1 + len(prime_nums)
print(ans)


### FIXED CODE ###

import math
from fractions import gcd
A,B = (int(i) for i in input().split())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N = gcd(A,B)
N_divisors = make_divisors(N)
prime_nums = []
for i in range(1,len(N_divisors)):
  if i == 1:
    prime_nums.append(N_divisors[i])
  else:
    for j in range(1,i):
      if N_divisors[i]%N_divisors[j] == 0:
        break
      if j == i-1:
        prime_nums.append(N_divisors[i])

ans = 1 + len(prime_nums)
print(ans)
o = list(input())
e = list(input())
ans = ""

num = len(o)
if num%2==0:
    for n in range(num):
        ans += o[n] + e[n]
else:
    for n in range(num):
        ans += o[n] + e[n]
    ans += o[num-1]
print(ans)

### FIXED CODE ###

o = list(input())
e = list(input())
ans = ""

olen = len(o)
num = olen - len(e)
if num==0:
    for n in range(olen):
        ans += o[n] + e[n]
else:
    for n in range(len(e)):
        ans += o[n] + e[n]
    ans += o[olen-1]
print(ans)
import sys
from collections import defaultdict
import math
input = sys.stdin.readline
N, M = [int(x) for x in input().strip().split()]
d = defaultdict(int)
M_ = M
MOD = 10 ** 9 + 7
while True:
    for i in range(2, int(M_ ** 0.5) + 1):
        if M_ % i == 0:
            M_ //= i
            d[i] += 1
            break
    else:
        if M_ != 1:
            d[M_] += 1
        break

maxi = max(d.values())
fact = [0] * (maxi + N + 1)
p = 1

def nCr(n, r):
    if r > n - r:
        r = n - r
    if r == 0:
        return 1
    if r == 1:
        return n

    return math.factorial(n) // math.factorial(n - r) // math.factorial(r)

ans = 1
nCr_d = {}
for key, val in d.items():
    if (val+N-1, N-1) not in nCr_d:
        nCr_d[(val+N-1, N-1)] = nCr(val+N-1, N-1)
    ans = (ans * nCr_d[(val+N-1, N-1)]) % MOD

print(ans)

### FIXED CODE ###

import sys
from collections import defaultdict
import math
input = sys.stdin.readline
N, M = [int(x) for x in input().strip().split()]
d = defaultdict(int)
M_ = M
MOD = 10 ** 9 + 7

if M == 1:
    print(1)
    exit()

while True:
    for i in range(2, int(M_ ** 0.5) + 1):
        if M_ % i == 0:
            M_ //= i
            d[i] += 1
            break
    else:
        if M_ != 1:
            d[M_] += 1
        break

maxi = max(d.values())
fact = [0] * (maxi + N + 1)
p = 1

def nCr(n, r):
    if r > n - r:
        r = n - r
    if r == 0:
        return 1
    if r == 1:
        return n

    ret = 1
    for i in range(n, n-r, -1):
        ret *= i
    for i in range(2, r+1):
        ret //= i

    return ret

ans = 1
nCr_d = {}
for key, val in d.items():
    if (val+N-1, N-1) not in nCr_d:
        nCr_d[(val+N-1, N-1)] = nCr(val+N-1, N-1)
    ans = (ans * nCr_d[(val+N-1, N-1)]) % MOD

print(ans)
def Fib(n):
    a, b = 1, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
m = Fib(a[0])*Fib(N-a[M-1])
flag = True
for i in range(M-1):
  if a[i] + 1 == a[i+1]:
    print(0)
    flag = False
    break
if flag:
    for j in range(M-1):
        dev = a[j+1]-a[j]
        m = m*Fib(dev)
    print(m%1000000007)

### FIXED CODE ###

def Fib(n):
    a, b = 1, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

flag = True
if M == 1:
    print(Fib(a[0])*Fib(N-a[M-1]))
elif M == 0:
    print(Fib(N+1)%1000000007)
else:
    m = Fib(a[0])*Fib(N-a[M-1])
    for i in range(M-1):
        if a[i] + 1 == a[i+1]:
            print(0)
            flag = False
            break
    if flag:
        for j in range(M-1):
            dev = a[j+1]-a[j]-1
            m = m*Fib(dev)%1000000007
        print(m%1000000007)
N = int(input())

moji = [chr(i) for i in range(97, 97+26)]


lst = [0]
n = 0
for i in range(1,12):
    n = n + 26 ** i
    lst.append(n)

#lst.sort(reverse=True)
#print(lst)
keta = 0
for i in range(len(lst)):
    if N <= lst[i]:
        keta = i
        break

keta -= 1
ans = []
for i in range(keta+1):
    tmp = N // (26**keta)
    ans.append(tmp)
    N = N % (26**keta)
    keta -= 1
#print(ans)

answer = ''
for i in ans:
    answer += moji[i-1]
print(answer)

### FIXED CODE ###

n = int(input())

moji = [chr(i) for i in range(97, 97+26)]
ans = ''
while n > 0:
    n -= 1
    x = int(n % 26)
    ans = moji[n % 26] + ans
    n //= 26
print(ans)
def solve():
  X = raw_input()
  Y = raw_input()
  a = len(X)
  b = len(Y)
  c1 = [0 for i in range(b+1)]
 
  for i in range(a):
    c2 = c1 + []
    for j in range(b):
      if X[i] == Y[j]:
        c1[j+1] = c2[j] + 1
      elif c1[j+1] < c1[j]:
        c1[j+1] = c1[j]
 
  return c1[-1]
 
n = input()
for k in range(q):
  print solve()

### FIXED CODE ###

def solve():
  X = raw_input()
  Y = raw_input()
  a = len(X)
  b = len(Y)
  c1 = [0 for i in range(b+1)]
 
  for i in range(a):
    c2 = c1 + []
    for j in range(b):
      if X[i] == Y[j]:
        c1[j+1] = c2[j] + 1
      elif c1[j+1] < c1[j]:
        c1[j+1] = c1[j]
 
  return c1[-1]
 
n = input()
for k in range(n):
  print solve()
H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

if H1<H2:
    print((M2 + H2*60 - (M1 + H1*60)) - K)
else:
    print(M2 + H2*60 + ((60-M1)+(24-H1)*60) - K)

### FIXED CODE ###

h1,m1,h2,m2,k = map(int, input().split())
print(m2-m1+(h2-h1)*60-k)
n,m,k=list(map(int,input().split()))
a=list(map(int,input().split()))
b=list(map(int,input().split()))
from collections import deque
p=deque(a)
q=deque(b)

import sys
time=0
ans=0
while(1):
    if len(p)==0 and len(q)==0:
        print(ans)
        sys.exit()
    if len(p)>0 and len(q)>0:
        if p[0]>q[0]:
            time=time+q.popleft()
            if time>k:
                print(ans)
                sys.exit()
            else:
                ans=ans+1
        elif p[0]<q[0]:
            time=time+p.popleft()
            if time>k:
                print(ans)
                sys.exit()
            else:
                ans=ans+1
        else:
            if p[1]>=q[1]:
                la=q.popleft()
                if la==1000000000:
                    print(ans)
                    sys.exit()
                time=time+la
                if time>k:
                    print(ans)
                    sys.exit()
                else:
                    ans=ans+1
            else:
                la=p.popleft()
                if la==1000000000:
                    print(ans)
                    sys.exit()
                time=time+la
                if time>k:
                    print(ans)
                    sys.exit()
                else:
                    ans=ans+1
    elif len(p)==0:
        la=q.popleft()
        if la==1000000000:
            print(ans)
            sys.exit()
        time=time+la
        if time>k:
            print(ans)
            sys.exit()
        else:
            ans=ans+1
    elif len(q)==0:
        la=p.popleft()
        if la==1000000000:
            print(ans)
            sys.exit()
        time=time+la
        if time>k:
            print(ans)
            sys.exit()
        else:
            ans=ans+1


### FIXED CODE ###

#Aの上からi冊、Bの上からj冊をとりi+jを条件を満たしながら最大化したい
#累積和と二分探索の練習問題
#値を固定するという概念。iが決まればjが決まる
from bisect import bisect_left
from itertools import accumulate
n,m,k=list(map(int,input().split()))
a=list(map(int,input().split()))
b=list(map(int,input().split()))
A=[0]+list(accumulate(a))
B=[0]+list(accumulate(b))

ans=0
sup_i=bisect_left(A,k+1)
for i in range(sup_i):
  ans=max(ans,i+bisect_left(B,k-A[i]+1)-1)
 
print(ans)
import math
import sys
import sympy
import itertools
from math import gcd
from math import sqrt
from sys import stdin
def input() : return stdin.readline().rstrip()
def mips():
    return map(int,input().split())
def ii():
    return int(input())
sys.setrecursionlimit(10**9)

A,VA = mips()
B,VB = mips()
T = ii()
d1 = A + VA * T
d2 = B + VB * T
if d1 - d2 >= 0:
    print("YES")
else:
     print("NO")

### FIXED CODE ###


import sys
import itertools
from math import gcd
from math import sqrt
from sys import stdin
def input() : return stdin.readline().rstrip()
def mips():
    return map(int,input().split())
def ii():
    return int(input())
sys.setrecursionlimit(10**9)
A,VA = mips()
B,VB = mips()
T = ii()
if A <= B:
    d1 = A + VA * T
    d2 = B + VB * T
    if d1 >= d2:
        print("YES")
    else:
        print("NO")
else:
    d2 = B - VB * T
    d1 = A - VA * T
    if d1 <= d2:
        print("YES")
    else:
        print("NO")
n,k = input().split(' ')
n = int(n)
k = int(k)
h = []
for i in range(n):
    h.append(int(input()))
h.sort()
diffs = []
for i in range(n-k+1):
    diffs.append(h[i+k] - h[i])
print(min(diffs))


### FIXED CODE ###

day={
    25:'Christmas',
    24:'Christmas Eve',
    23:'Christmas Eve Eve',
    22:'Christmas Eve Eve Eve'
}

a = int(input())
print(day[a])
n, m = map(int, input().split())
if n % 2 != 0:
    for i in range(1, m + 1):
        print(i, n + 1 - i)
else:
    for i, j in range(1, m + 1), range(1, m + 1):
        if i == n / 2:
            i += 1
        print(i, n - j)
        i += 1

### FIXED CODE ###

n,m=map(int,input().split())
if n%2==1:
    [print(i+1,n-i) for i in range(m)]
else:
    [print(i+1,n-i) if i<m/2 else print(i+1,n-i-1) for i in range(m)]
n = int(input())
a = set()
for _ in range(n):
    a.append(input())
print(len(a))


### FIXED CODE ###

N = int(input())
print(len(set([input() for _ in range(N)])))
H, W = map(int, input().split())

if H == 1 or W == 1:
    print(1)
    quit()

ans = (math.ceil(W / 2) * math.ceil(H / 2)) + ((W // 2) * (H // 2))

print(ans)

### FIXED CODE ###

import math
H, W = map(int, input().split())

if H == 1 or W == 1:
    print(1)
    quit()

ans = (math.ceil(W / 2) * math.ceil(H / 2)) + ((W // 2) * (H // 2))

print(ans)
from statistics import mode
n=int(input())
a=list(map(int,input().split()))
t=mode(a)
b=[i for i in range(n)if a[i]==t]
c=n+1
d=1
m=10**9+7
for i in range(1,n+2):
    if i==1:
        print(n)
    else:
        c=(c*(n-i+2))//i
        d=(d*(n-b[1]+b[0]+2-i))//(i-1)
        print((c-d)%m)

### FIXED CODE ###

m=10**9+7
n=int(input())
a=list(map(int,input().split()))
b=[0]*(n+1)
for i in range(n+1):
    if b[a[i]]==0:
        b[a[i]]=i+1
    else:
        s=b[a[i]]+n-i-1
        break
p,q=1,1
for i in range(1,n+2):
    p=((p*(n+2-i))*pow(i,m-2,m))%m
    q=(1 if i==1 and s>=i-1 else(0 if s<i-1 else ((q*(s-i+2))*pow(i-1,m-2,m)))%m)
    print((p-q)%m)
from collections import Counter
import sys
import sympy

def input():
    return sys.stdin.readline().strip()

# 改行またはスペース区切りの入力をすべて読み込んでイテレータを返します。
def get_all_int():
    return map(int, open(0).read().split())

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            yield i
            if i != n // i:
                yield n//i
        i += 1

n,*A = get_all_int()
A.sort()



C = dict(Counter(A))
keys = C.keys()
# log(C)

B = []
for i,a in enumerate(A):
    if C[a] == 1:
        B.append(a)

ans = 0

for i,a in enumerate(B):
    div = sympy.divisors(a)
    ok = True
    for d in div:
        if d == a:
            continue
        elif d in keys:
            ok = False
            break
    if ok:
        ans += 1

print(ans)


### FIXED CODE ###

from collections import Counter
import sys

def input():
    return sys.stdin.readline().strip()

# 改行またはスペース区切りの入力をすべて読み込んでイテレータを返します。
def get_all_int():
    return map(int, open(0).read().split())

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            yield i
            if i != n // i:
                yield n//i
        i += 1

n,*A = get_all_int()
A.sort()



C = dict(Counter(A))
keys = C.keys()
# log(C)

checks = [False] * (1000009)

B = []
for i,a in enumerate(A):
    if C[a] == 1:
        B.append(a)
    elif not checks[a]:
        for j in range(a, 1000009, a):
            checks[j] = True

# log(B)

ans = 0

for i,a in enumerate(B):
    if not checks[a]:
        ans += 1
        for j in range(a, 1000009, a):
            checks[j] = True

print(ans)