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

import sys
input = sys.stdin.readline
 
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
         
MOD = 10**9+7
n = [1, 1]
cnt = 2
while cnt!=N+1:
    if cnt-1 in a:n[1]=0
    n[0], n[1] = n[1], (n[0]+n[1])%MOD 
    cnt += 1
    if n[1]==0:break
 
print(n[-1]%(10**9+7))

### FIXED CODE ###

import sys
input = sys.stdin.readline

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

broken= [False]*(N+1)
for i in range(M):
    broken[int(input())] = True

dp = [0]*(N+1)
dp[0] = 1
if not broken[1]:dp[1] = 1

         
for i in range(2, N+1):
    if broken[i]:continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= (10**9 + 7)
print(dp[N])
### BUGGY CODE ###

import sys
from collections import defaultdict

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_na = lambda: map(int, read().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():
    N = in_n()
    A = list(in_nn())
    Q = in_n()
    t = in_na()
    BC = list(zip(t, t))

    d = defaultdict(int)
    for i in range(N):
        d[A[i]] += 1

    for i in range(Q):
        b, c = BC[i]
        d[c] += d[b]
        d.pop(b)

        ans = 0
        for k, v in d.items():
            ans += k * v
        print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
from collections import defaultdict

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_na = lambda: map(int, read().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():
    N = in_n()
    A = list(in_nn())
    Q = in_n()
    t = in_na()
    BC = list(zip(t, t))

    d = defaultdict(int)
    for i in range(N):
        d[A[i]] += 1

    s = 0
    for k, v in d.items():
        s += k * v

    for i in range(Q):
        b, c = BC[i]
        s += d[b] * (c - b)
        d[c] += d[b]
        d.pop(b)

        print(s)


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

from functools import lru_cache
@lru_cache(maxsize=3000)
def burger(str_b,level):
  if(level == 0):
    return str_b + 'p'
  str_b += 'B'
  str_b = burger(str_b,level-1)
  str_b += 'p'
  str_b = burger(str_b,level-1)
  str_b += 'B'
  return str_b


str_b = ''
N,X = map(int,input().split())
str_b = burger(str_b,N)
b_list = list(str_b)
eat_list = b_list[::-1]
eat_list = b_list[0:X]
print(eat_list.count('p'))

### FIXED CODE ###

n,x = map(int,input().split())
a,p = [1],[1]
for i in range(n):
  a.append(2*a[i]+3)
  p.append(2*p[i]+1)

def f(N,X):
  if N==0:
    return 0 if X<=0 else 1
  elif X <= 1+a[N-1]:
    return f(N-1,X-1)
  else:
    return p[N-1]+1+f(N-1,X-2-a[N-1])
print(f(n,x))
### BUGGY CODE ###

N = int(input())
s = []
s = [input() for i in range(N)]
count = 0
for i in range(N):
    for a in range(i+1,N):
        if sorted(s[i]) == sorted(s[a]):
            count += 1

print(count)


### FIXED CODE ###

N = int(input())
s = []
s = [input() for i in range(N)]
count = 0
a = []
sortdict = {}
for i in range(N):
    a = str(sorted(s[i]))
    if a in sortdict:
        sortdict[a] += 1
    else:
        sortdict[a] = 0
sort_list = list(sortdict.values())
for i in range(len(sort_list)):
    sort_list[i] = int((sort_list[i])*(sort_list[i] + 1)/2)
 

print(sum(sort_list))
### BUGGY CODE ###

a,b,x=map(int,input().split())
array=[]
for i in range(a,b+1):
    if i%x==0:
        array.append(i)
print(len(array))


### FIXED CODE ###

a,b,x=map(int,input().split())
print(b//x-(a-1)//x)
### BUGGY CODE ###

N, M = map(int, input().split())
PY = [list(map(int, input().split())) for _ in range(M)]

A = [[] for _ in range(N+1)]
for py in PY:
    A[py[0]].append(py[1])

for i in range(N+1):
    A[i] = sorted(A[i])

for py in PY:
    pref = py[0]
    city = A[pref].index(py[1])+1
    print(str(pref).zfill(6) + str(city).zfill(6))

### FIXED CODE ###

N, M = map(int, input().split())
PY = [list(map(int, input().split())) for _ in range(M)]

A = [[] for _ in range(N+1)]

for i, py in enumerate(PY):
    A[py[0]].append([py[1], i])

City = []
for i in range(N+1):
    A[i] = sorted(A[i])
    for j, a in enumerate(A[i]):
        pref = i
        city = j+1
        City.append([a[1], str(pref).zfill(6) + str(city).zfill(6)])

City = sorted(City)
for city in City:
    print(city[1])
### BUGGY CODE ###

from collections import Counter
N=int(input())
X=input()

value = int(X,2)
#print(value)
TFlist =[]
for i in range(N):
  if X[i] == '0':
  	TFlist.append(False)
  else:
    TFlist.append(True)
#print(TFlist)
p = sum(TFlist)


def count_ones_by_bin(num):
    bin_num = bin(num)[2:]
    count = 0
    for i in bin_num:
            count += int(i)
    return count
  
def popcount(n):
 # print("popcount",n)
  return (n  % count_ones_by_bin(n))

for i in range(N):
#  print("N", N)
  cnt = 0
  tmp = 0
  if p != 1 or (not TFlist[i]):
    if TFlist[i]: tmp = (value - (pow(2,(N-i-1), (p-1)))) % (p-1)
    else: tmp = (value +  pow(2,(N-i-1), (p+1) )  ) % (p+1)
    # print(tmp)
    cnt += 1
  while tmp != 0:
    cnt+= 1
    tmp = popcount(tmp)
  print(cnt)

### FIXED CODE ###

from collections import Counter
N=int(input())
X=input()

value = int(X,2)
#print(value)
TFlist =[]
for i in range(N):
  if X[i] == '0':
  	TFlist.append(False)
  else:
    TFlist.append(True)
#print(TFlist)
p = sum(TFlist)


def count_ones_by_bin(num):
    bin_num = bin(num)[2:]
    count = 0
    for i in bin_num:
            count += int(i)
    return count
  
def popcount(n):
 # print("popcount",n)
  return (n  % count_ones_by_bin(n))

for i in range(N):
#  print("N", N)
  cnt = 0
  tmp = 0
  if p != 1 or (not TFlist[i]):
    if TFlist[i]: tmp = (value % (p-1) - (pow(2,(N-i-1), (p-1)))) % (p-1)
    else: tmp = (value % (p+1) + (pow(2,(N-i-1) , (p+1) ) ) ) % (p+1)    
    cnt += 1
  while tmp != 0:
    cnt+= 1
    tmp = popcount(tmp)
  print(cnt)
### BUGGY CODE ###

import math
from functools import reduce
import itertools
import numpy as np

def gcd(*numbers):
    return reduce(math.gcd, numbers)
  
def gcd_list(numbers):
    return reduce(math.gcd, numbers)

K=int(input())
 
l = [i for i in range(1,K+1)]
 
temp_sum=[]
for j in itertools.product(l, repeat=3):
    temp_sum.append(gcd_list(list(j)))

print(np.sum(temp_sum))

### FIXED CODE ###

import math
from functools import reduce
import itertools
import numpy as np

K = int(input())



ans = 0
for i in range(1, K + 1):
    for j in range(i, K + 1):
        for k in range(j, K + 1):
            if i == j and j == k:
                dup_num = 1
            elif i == j or j == k:
                dup_num = 3
            else:
                dup_num = 6
            ans += math.gcd(math.gcd(i, j), k) * dup_num

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

from itertools import combinations as cmb
N = int(input())
L = list(map(int, input().split()))

res = 0
for a, b, c in cmb(L, 3):
    if a < b + c and b < c + a and c < a + b:
        res += 1

print(res)


### FIXED CODE ###

import bisect

N = int(input())
L = sorted(map(int, input().split()))

res = 0
for i in reversed(range(1, N)):
    for j in reversed(range(i)):
        index = bisect.bisect_left(L, L[i] + L[j])
        n = N - index
        res += (N - 1 - i) - n

print(res)
### BUGGY CODE ###

N=int(input())
S=list(input())
cnt=0
for i in range(N):
    for j in range(i+1,N):
        if S[i]!=S[j]:
            for k in range(j+1,N):
                if S[j]!=S[k] and S[i]!=S[k] and (j-i!=k-j):
                    cnt+=1
print(cnt)

### FIXED CODE ###

N=int(input())
S=input()
cnt=S.count("R")*S.count("G")*S.count("B")
for i in range(N):
    for j in range(i+1,N):
        k=2*j-i
        if k<N and S[i]!=S[j]!=S[k]!=S[i]:
            cnt-=1
print(cnt)
### BUGGY CODE ###

L, R = map(int, input().split())
mod = 2019

minimum = 2019
for i in range(L, R):
    mod_i = i % mod
    for j in range(i+1, R+1):
        mod_j = j % mod
        result = (mod_i * mod_j) % mod
        if result < minimum:
            minimum = result
print(minimum)


### FIXED CODE ###

L, R = map(int, input().split())
mod = 2019

minimum = 2019
for i in range(L, R):
    mod_i = i % mod
    for j in range(i+1, R+1):
        mod_j = j % mod
        result = (mod_i * mod_j) % mod
        if result < minimum:
            minimum = result
        if minimum == 0:
            print(0)
            exit(0)
print(minimum)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**9)

n, m = map(int, input().split())
graph = [[] for _ in range(n)]
dp = [-1 for _ in range(n)]

for _ in range(m):
    x, y = map(int, input().split())
    graph[x-1].append(y-1)


def dfs(s):
    #print(s, dp)
    if dp[s] != -1:
        return dp[s]
    
    rep = 0
    for g in graph[s]:
        rep = max(rep, dfs(g)+1)
    dp[s] = rep
    return rep

def dfs2(s):
    rep = 0
    for g in graph[s]:
        rep = max(rep, dfs2(g)+1)
    #print(rep)
    return rep

#print(graph)
ans = 0
for i in range(n):
    #print('i:', i)
    ans = max(ans, dfs2(i))

print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

n, m = map(int, input().split())
graph = [[] for _ in range(n)]
dp = [-1 for _ in range(n)]

for _ in range(m):
    x, y = map(int, input().split())
    graph[x-1].append(y-1)


def dfs(s):
    #print(s, dp)
    if dp[s] != -1:
        return dp[s]
    
    rep = 0
    for g in graph[s]:
        rep = max(rep, dfs(g)+1)
    dp[s] = rep
    return rep

#print(graph)
ans = 0
for i in range(n):
    #print('i:', i)
    ans = max(ans, dfs(i))

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

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

l=[] # 寿司リスト。ただし，「おいしさ」を第1要素にする
dj=[] # 寿司タプルをそのまま入れる
s=set()

for i in range(N):
    t,d=map(int,input().split())
    l.append((d,t))
l.sort(reverse=True) 

ans=K**2
j=0 # 既に食べたことのある種類の寿司を更に食べた回数

for i in range(K): # i番目に食べる寿司について
    while l and l[0][1] in s:
        dj.append(l.pop(0))
    if (l and dj and l[0][0]>=dj[0][0]-(2*K-1-2*j)) or not dj:
        ans+=l[0][0]
        s.add(l[0][1])
        l.pop(0)
    else:
        ans+=dj[0][0]-(2*K-1-2*j)
        dj.pop(0)
        j+=1

print(ans)

### FIXED CODE ###

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

l=[] # 寿司リスト。ただし，「おいしさ」を第1要素にする
m=[] # 寿司タプルをそのまま入れる
s=set()

for i in range(N):
    t,d=map(int,input().split())
    l.append((d,t))
l.sort(reverse=True) 

ans=K**2
t=0 # 既に食べたことのある種類の寿司を更に食べた回数

i=0 # l内を走査する際の添字
j=0 # m内を操作する際の添え字

for _ in range(K): # _番目に食べる寿司について
    while i<N and l[i][1] in s:
        m.append(l[i]) # そのままmに追加する
        i+=1 # lの先頭の要素を削除せず，
    if (i<N and (m and j<len(m)) and l[i][0]>=m[j][0]-(2*K-1-2*t)) or (not m or j>=len(m)):
        ans+=l[i][0]
        s.add(l[i][1])
        i+=1
    else:
        ans+=m[j][0]-(2*K-1-2*t)
        j+=1
        t+=1

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

n = int(input())
a = [int(input()) for _ in range(n)]

for i in range(n):
    t = a[:]
    t.pop(i)
    print(max(t))


### FIXED CODE ###

n = int(input())
maxindex = maxvalue = 0
a = []
for i in range(n):
    _a = int(input())
    if maxvalue <= _a:
        maxvalue = _a
        maxindex = i
    a.append(_a)

for i in range(n):
    if i != maxindex:
        print(maxvalue)
        continue
    t = a[:]
    t.pop(i)
    print(max(t))
### BUGGY CODE ###

import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, A, B = mapint()
if A+B-1>N or N>A*B:
    print(-1)
else:
    blocks = [[] for _ in range(A)]
    cnt = N
    blocks[0] = list(range(B, 0, -1))
    flg = True
    while flg:
        flg = False
        for i in range(A-1, 0, -1):
            blocks[i].append(cnt)
            cnt -= 1
            if cnt==B:
                break
        else:
            flg = True
    ans = []
    for b in blocks:
        ans.extend(b)
    print(*ans)

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, A, B = mapint()
from collections import deque
if A+B-1>N or N>A*B:
    print(-1)
else:
    blocks = []
    blocks.append(' '.join(map(str, range(B, 0, -1))))
    now = B+1
    rest = N-A+2

    while now:
        if now>=rest:
            break
        if now+B>rest:
            blocks.append(' '.join(map(str, range(rest, now-1, -1))))
            rest += 1
            break
        blocks.append(' '.join(map(str, range(now+B-1, now-1, -1))))
        now = now+B
        rest += 1
    blocks.append(' '.join(map(str, range(rest, N+1))))
    print(' '.join(blocks))
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**7)
INF=10**18

def main():
    N,Z,W=map(int,input().split())
    a=list(map(int,input().split()))
    dic={}
    def rec(z,w,now,t):
        if dic.get((now,t),None)!=None:
            return dic[(now,t)]
        if now>=N-1:
            return abs(z-w)
        if not t:
            res=-INF
            for i in range(now+1,N):
                r=rec(a[i],w,i,1)
                res=max(res,r)
        else:
            res=INF
            for i in range(now+1,N):
                r=rec(z,a[i],i,0)
                res=min(res,r)
        dic[(now,t)]=res
        return res

    return rec(Z,W,-1,0)
    
print(main())

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
INF=10**18

def main():
    N,Z,W=map(int,input().split())
    a=list(map(int,input().split()))
    dic={}
    def rec(z,w,now,t):
        if dic.get((now,t),None)!=None:
            return dic[(now,t)]
        if now>=N-1:
            return abs(z-w)
        if not t:
            res=-INF
            for i in range(now+1,N):
                r=rec(a[i],w,i,1)
                res=max(res,r)
        else:
            res=INF
            for i in range(now+1,N):
                r=rec(z,a[i],i,0)
                res=min(res,r)
        dic[(now,t)]=res
        return res

    return rec(Z,W,-1,0)
    
print(main())
### BUGGY CODE ###

n,w = map(int,input().split())
items = sorted([list(map(int,input().split())) for i in range(n)])
dp = [[0]*(w+1) for _ in range(n+2)]
for i in range(n):
    wi, vi = items[i]
    for j in range(w+1):
        if j+wi<=w:
            dp[i+1][j+wi] = max(dp[i+1][j+wi], dp[i][j]+vi)
        dp[i+1][j] = max(dp[i][j], dp[i+1][j])
ans = 0
for i, (wi, vi) in enumerate(items):
    ans = max(ans, dp[i][w-1]+vi)
print(ans)


### FIXED CODE ###

n,w = map(int,input().split())
items = sorted([list(map(int,input().split())) for i in range(n)])
dp = [[0]*(w+1) for _ in range(n+2)]
for i in range(n):
    wi, vi = items[i]
    for j in range(w+1):
        if j+wi<=w:
            dp[i+1][j+wi] = max(dp[i+1][j+wi], dp[i][j]+vi)
        dp[i+1][j] = max(dp[i][j], dp[i+1][j])
ans = 0
for i, (wi, vi) in enumerate(items):
    ans = max(ans, dp[i][w-1]+vi)
print(ans)
### BUGGY CODE ###

n=int(input())
a=list(map(int, input().split()))
b=list(map(int, input().split()))
c=list(map(int, input().split()))
cnt=0
count=0

a.sort()
b.sort()
c.sort()

for i in range(n):
    for j in range(n):
        for k in range(n):
            if c[i]>b[j]>a[k]:
                count+=1
print(count)

### FIXED CODE ###

import bisect

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

a.sort()
b.sort()
c.sort()

ans=0

for i in range(n):
    x=bisect.bisect_right(a,b[i]-1)
    y=n-bisect.bisect_left(c,b[i]+1)

    ans+=x*y

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

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()
ans = 0
def func(array, value):
  ng = -1
  ok = len(array)
  #if value
  while ok - ng > 1:
    mid = (ok + ng)//2
    if array[mid] < value:
      ng = mid
    elif array[mid] >= value:
      ok = mid
  return ok
for a in A:
  b_idx = func(B, a + 1)
  if b_idx == len(B):
    continue
  #print('a', a)
  #print('B[b_idx:]',B[b_idx:])
  for b in B[b_idx:]:
    c_idx = func(C, b + 1)
    #print('b',b)
    #print('C[c_idx:]',C[c_idx:])
    if c_idx == len(C):
      continue
    #print(a, b_idx, c_idx)
    ans += len(C) - c_idx
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()
ans = 0
def low_func(array, value):
  ng = -1
  ok = len(array)
  #if value
  while ok - ng > 1:
    mid = (ok + ng)//2
    if array[mid] < value:
      ng = mid
    elif array[mid] >= value:
      ok = mid
  return ok

def up_func(array, value):
  ok = -1
  ng = len(array)
  #if value
  while abs(ok - ng) > 1:
    mid = (ok + ng)//2
    if array[mid] <= value:
      ok = mid
    elif array[mid] > value:
      ng = mid
  return ok

for b in B:
  a_idx = up_func(A, b - 1)
  if a_idx == -1:
    continue
  c_idx = low_func(C, b + 1)
  if c_idx == len(C):
    break
  ans += (a_idx + 1)*(len(C) - c_idx)
print(ans)
### BUGGY CODE ###

N, W = map(int, input().split())
Data = [list(map(int, input().split())) for _ in range(N)]

dp = [[None for _ in range(W+1)] for _ in range(N+1)]
dp[0] = [0]*(W+1)

for i in range(1, N+1):
    for j in range(W+1):
        if Data[i-1][0] <= j:
            dp[i][j] = max(dp[i-1][j], dp[i-1][j-Data[i-1][0]] + Data[i-1][1])
        else:
            dp[i][j] = dp[i-1][j]

print(max(dp[-1]))


### FIXED CODE ###

N, W = map(int, input().split())
Data = [list(map(int, input().split())) for _ in range(N)]
sum_value_aploximate = N * 10**3 + 1

dp = [[None for _ in range(sum_value_aploximate)] for _ in range(N+1)]
temp = float("inf")
dp[0] = [temp for _ in range(sum_value_aploximate)]
dp[0][0] = 0

for i in range(1, N+1):
    for j in range(sum_value_aploximate):
        if Data[i-1][1] <= j:
            dp[i][j] = min(dp[i-1][j], (dp[i-1][j-Data[i-1][1]] + Data[i-1][0]))
        else:
            dp[i][j] = dp[i-1][j]

ans = 0
for j in range(sum_value_aploximate):
    if dp[N][j] <= W:
        ans = max(ans, j)

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

# 未完成
import numpy as np
import sys
N = int(input())
x = np.zeros(N)
y = np.zeros(N)
kouholist = []
ans = []
if N == 1:
    print(1)
    sys.exit()

for i in range(N):
    x[i], y[i] = map(int, input().split())
for m in range(N):
    for p in range(N):
        if m == p:
            continue
        diff_x = x[m] - x[p]
        diff_y = y[m] - y[p]

        ans_kari = 0
        for r in range(N):
            for q in range(N):
                if x[q] - x[r] == diff_x and y[q] - y[r] == diff_y:
                    ans_kari += 1
        ans.append(ans_kari)

print("{}".format(N-max(ans)))


### FIXED CODE ###

# 未完成

import sys
N = int(input())
x = [0]*N
y = [0]*N
kouholist = []
ans = N
if N == 1:
    print(1)
    sys.exit()

for i in range(N):
    x[i], y[i] = map(int, input().split())
for m in range(N):
    for p in range(N):
        if m == p:
            continue
        diff_x = x[m] - x[p]
        diff_y = y[m] - y[p]
        ans_kari = N
        for r in range(N):
            for q in range(N):
                if x[q] - x[r] == diff_x and y[q] - y[r] == diff_y:
                    ans_kari -= 1
        if ans_kari < ans:
            ans = ans_kari

print("{}".format(ans))
### BUGGY CODE ###

import collections
N = int(input())
cA = collections.Counter([int(_) for _ in input().split()])
factors = set([])
ans = 0
for a in sorted(cA.keys()):
    if cA[a] > 1:
        factors.add(a)
        continue
    ok = True
    for f in factors:
        if a % f == 0:
            ok = False
            break
    if ok:
        ans += 1
        factors.add(a)
print(ans)


### FIXED CODE ###

import collections
N = int(input())
cA = collections.Counter([int(_) for _ in input().split()])
cand = set(range(1, 1000001))
ans = 0
for a in sorted(cA.keys()):
    if a in cand:
        if cA[a] == 1:
            ans += 1
        for c in range(a, 1000001, a):
            if c in cand:
                cand.remove(c)
print(ans)
### BUGGY CODE ###

import numpy as np

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

s=np.array(s).reshape((D,26))

def score(T):
    last=[-1]*26
    v=0
    for d in range(D):
        v+=s[d][T[d]-1]
        last[T[d]-1]=d
        for i in range(26):
            v-=c[i]*(d-last[i])
    return v

import random
best=0

for x in range(4000):
    if x==0:
        tmp=[random.randint(1, 26) for _ in range(D)]
        tbest=tmp+[]
    else:
        tmp=[random.randint(1, 26) for _ in range(D)]
    sc=score(tmp)
    if (10**6+sc)>best:
        tbest=tmp+[]
        best=10**6+sc
    else:
        continue

for i in range(D):
    print(tbest[i])

### FIXED CODE ###

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

def score(T):
    last=[-1]*26
    v=0
    for d in range(D):
        v+=s[d][T[d]-1]
        last[T[d]-1]=d
        for i in range(26):
            v-=c[i]*(d-last[i])
    return v

import random
best=0

for x in range(4000):
    if x==0:
        tmp=[random.randint(1, 26) for _ in range(D)]
        tbest=tmp
    else:
        tmp=[random.randint(1, 26) for _ in range(D)]
    if score(tmp)>best:
        tbest=tmp
    else:
        continue

for t in tbest:
    print(t)
### BUGGY CODE ###

N = int(input())
flag = 0
for a in range(1,3501):
    if flag ==1:
        break
    for b in range(1,3501):
        if 4*a*b - a*N - b*N != 0:
            if a*b*N // (4*a*b - a*N - b* N) > 0 and a*b*N % (4*a*b - a*N - b* N) ==0:
                c = int(a*b*N / (4*a*b - a*N - b* N))
                print(a, b, c)
                flag = 1
                break

### FIXED CODE ###

N = int(input())
flag = 0
for a in range(1,3501):
    if flag ==1:
        break
    for b in range(1,3501):
        if 4*a*b - a*N - b*N != 0:
            if a*b*N // (4*a*b - a*N - b* N) > 0 and a*b*N % (4*a*b - a*N - b* N) ==0:
                c = int(a*b*N / (4*a*b - a*N - b* N))
                print(a, b, c)
                flag = 1
                break
### BUGGY CODE ###

N = int(input())						# 5
A =        list( map(int, input().split()) )	# 1 2 3 4 5 ...

A.sort()

ans=0
for i in range(N):
  for j in range(N):
    if i==j: continue
    if A[i] % A[j] == 0: break
    if A[i] < A[j]:
      ans += 1
      break
  else:
    ans += 1

print(ans)



### FIXED CODE ###

N = int(input())						# 5
A =        list( map(int, input().split()) )	# 1 2 3 4 5 ...

A.sort()
maxA = A[-1]
X = [0]*(maxA+1)


for a in A:
  for i in range(1,maxA+1):
    x = a*i
    if x > maxA: break
    X[x] += 1

ans = 0
for a in A:
  if X[a]==1: ans+=1

print(ans)
# print(A)
# print(X)
### BUGGY CODE ###

from math import sqrt, ceil
import sys

N, M = map(int, input().split())
rootM = max(ceil(sqrt(M)), M//N)

for m in reversed(range(1, rootM+1)):
    if M % m == 0:
        # print(m)
        if M // m >= N:
            print(m)
            sys.exit()

### FIXED CODE ###

from math import sqrt, floor
 
N, M = map(int,input().split())
 
rootM = floor(sqrt(M))
l = []
for i in range(1, rootM +1):
    if M % i == 0:
        l.append(i)
        l.append(M//i)
        
ans = 1
for li in l:
    ans = max(ans, li) if li <= M // N else ans
print(ans)
### BUGGY CODE ###

n = int(input())
c=0
for i in range(1,n):
  a = 0
  while a<n-i:
    a+=i
    c+=1
 
print(c)

### FIXED CODE ###

n = int(input())
c=0
for i in range(1,n):
  a = 0
  while a<n-i:
    a+=i
    c+=1
 
print(c)