Harryxun/stf_run huggingface dataset:
import numpy as np

a, b, c, d = [int(i) for i in input().split()]

num = np.arange(b - a + 1) + a
print(num[num % (c * d) != 0].shape[0])

### FIXED CODE ###

import numpy as np
import math

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

a, b, c, d = [int(i) for i in input().split()]
#
#num = np.arange(b - a + 1) + a
#
#if b < c and b < d:
#    print('0')
#    exit(0)
#
#m = min(c, d)
#div = max(c, d)
#tmp = []
#div = num[0] // div + div
#index = 0
#while True:
#    if n[index] % div != 0:
#        if index + div >
#        tmp += range(n[index], n[index])
#        index += 1
#    else:
#        index += div
#
#tmp = np.array(tmp)
#print(tmp[tmp % m == 0].shape[0])


size = b - a + 1
cd = int(c * d // gcd(c, d))
c_num_a = a // c
d_num_a = a // d
cd_num_a = a // cd
c_num_b = b // c
d_num_b = b // d
cd_num_b = b // cd

c_num = c_num_b - c_num_a
d_num = d_num_b - d_num_a
cd_num = cd_num_b - cd_num_a

if a % c == 0:
    c_num += 1
if a % d == 0:
    d_num += 1
if a % cd == 0:
    cd_num += 1

print(size - c_num - d_num + cd_num)
n,m = map(int,input().split())

if m==1 and n==1:
  print(1)
elif m==2:
  print(0)
elif n==2:
  print(0):
else:
  print(max(1,n-2)*max(1,m-2))

### FIXED CODE ###

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

if m==1 and n==1:
  print(1)
elif m==2:
  print(0)
elif n==2:
  print(0)
else:
  print(max(1,n-2)*max(1,m-2))
n, m = map(int, input().split())
A = list(map(int, input().split()))
BC = [tuple(map(int, input().split())) for _ in range(m)]

A.sort()
BC.sort(key=lambda x: x[1], reverse=True)

cnt = 0
for b, c in BC:
    for i in range(b):
        if c < A[cnt]:
            continue
        A[cnt] = c
        cnt += 1
    if cnt >= n:
        break

print(sum(A))

### FIXED CODE ###

n, m = map(int, input().split())
A = list(map(int, input().split()))
BC = [tuple(map(int, input().split())) for _ in range(m)]

A.sort()
BC.sort(key=lambda x: x[1], reverse=True)

cnt = 0
for b, c in BC:
    for i in range(b):
        if c < A[cnt]:
            break
        A[cnt] = c
        cnt += 1
        if cnt >= n:
            break
    else:
        continue
    break

print(sum(A))
import numpy as np


# 解がマイナスのとき
def solve1(k, ml, pl):
    left, right = -(10 ** 18) - 1, 0
    while right - left > 1:
        x = (left + right) // 2
        n = (len(pl) - np.searchsorted(pl, x / ml)).sum()
        if k <= n:
            right = x
        else:
            left = x
    return right


# 解がプラスのとき
def solve2(k, ml, pl):
    left, right = 0, 10 ** 18
    while right - left > 1:
        x = (left + right) // 2
        n = 0
        n += (len(ml) - np.searchsorted(ml, x / ml)).sum()
        n -= np.count_nonzero(ml ** 2 <= x)
        n += (np.searchsorted(pl, x // pl, side="right")).sum()
        n -= np.count_nonzero(pl ** 2 <= x)
        assert n % 2 == 0
        n //= 2
        if k <= n:
            right = x
        else:
            left = x
    return right


def main():
    N, K = list(map(int, input().split()))
    A = np.array(input().split(), dtype=int)
    A.sort()
    ml = A[A < 0]
    pl = A[A > 0]
    zl = A[A == 0]
    mn = len(ml) * len(pl)
    zn = sum([N - i - 1 for i in range(len(zl))])
    if K <= mn:
        ans = solve1(K, ml, pl)
    elif K <= mn + zn:
        ans = 0
    else:
        ans = solve2(K - mn - zn, ml, pl)
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###


import numpy as np


# 解がマイナスのとき
def solve1(k, ml, pl):
    left, right = -(10 ** 18) - 1, 0
    while right - left > 1:
        x = (left + right) // 2
        n = (len(pl) - np.searchsorted(pl, x // ml + (x % ml != 0))).sum()
        if k <= n:
            right = x
        else:
            left = x
    return right


# 解がプラスのとき
def solve2(k, ml, pl):
    left, right = 0, 10 ** 18
    while right - left > 1:
        x = (left + right) // 2
        n = 0
        n += (len(ml) - np.searchsorted(ml, x // ml + (x % ml != 0))).sum()
        n -= np.count_nonzero(ml ** 2 <= x)
        n += (np.searchsorted(pl, x // pl, side="right")).sum()
        n -= np.count_nonzero(pl ** 2 <= x)
        assert n % 2 == 0
        n //= 2
        if k <= n:
            right = x
        else:
            left = x
    return right


def main():
    N, K = list(map(int, input().split()))
    A = np.array(input().split(), dtype=int)
    A.sort()
    ml = A[A < 0]
    pl = A[A > 0]
    zl = A[A == 0]
    mn = len(ml) * len(pl)
    zn = sum([N - i - 1 for i in range(len(zl))])
    if K <= mn:
        ans = solve1(K, ml, pl)
    elif K <= mn + zn:
        ans = 0
    else:
        ans = solve2(K - mn - zn, ml, pl)
    print(ans)


if __name__ == "__main__":
    main()
n = int(input())
a = list(map(int(input().split())))
cnt = [0] * int(1e6)
for i in a:
    cnt[i-1] += 1
    cnt[i] += 1
    cnt[i+1] += 1
print(max(cnt))


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
cnt = [0] * int(1e6)
for i in a:
    cnt[i-1] += 1
    cnt[i] += 1
    cnt[i+1] += 1
print(max(cnt))
import numpy as np
import decimal as dec

num = [int(n) for n in input().split()] 
    
s = sum(num[1:num[0]+1])/num[0]
s = round(s)
r = 0
for i in range(1,num[0]+1):
    r += pow(num[i]-s,2)
print(r)

### FIXED CODE ###

import sys

num = []

while True:
    try:
        num.extend([int(n) for n in input().split()])
    except EOFError:
        break
    
s = sum(num[1:num[0]+1])/num[0]
s = round(s)
r = 0
for i in range(1,num[0]+1):
    r += pow(num[i]-s,2)
print(r)
P = []
S = []
for i in range(2):
    pp, ss  = map(int, input().split())
    P.append(pp)
    S.append(ss)

A = P[0]
V = P[1]
B = S[0]
W = S[1]
T = int(input())

def run():
	if A < B:
		c = (B + V*T) - (A + W*T)
		if c <= 0 :
			return 'YES'
		else :
			return 'NO'
	elif A > B:
		c = (A - W*T) - (B - V*T)
		if c <= 0 :
			return 'YES'
		else :
			return 'NO'
	else :
		return 'YES'
print(run())

### FIXED CODE ###

a = input()
nickname = a[0:3]
print(nickname)
number = int(input())
nums = list(map(int, input().split(" ")))

print(max(nums) - min(nums))


### FIXED CODE ###

num = int(input())

if num % 2 == 0:
    print(num)
else:
    print(num*2)
import sys
input = sys.stdin.readline().rstrip

"""
まず一般に剰余込みでの組み合わせの計算。
n!, (n!)^{-1} mod pの値を配列にまとめておき、nCr = (n!)/(r!)((n-r)!)をO(1)で計算する。

max = (用意する配列の最大長)
mod = （剰余）

(n!)^{-1}の計算は¥Prod_i i^{-1}を計算して求める。
i^{-1} mod pの計算はフェルマーの小定理より、mod pにおいて
0 = p = (p // i) * i + (p % i)
0 = (p // i) + (p % i) * i^{-1}
i^{-1} = -(p // i) * (p % i)^{-1}
"""

max = 10**6 + 1 # ここでRE出しまくってた。。。
mod = 10**9+7
fact = [1, 1] # fact[n] = (n! mod p)
factinv = [1, 1] # factinv[n] = ((n!)^{-1} mod p)
inv = [0, 1] # inv[n] = (n^{-1} mod p)

for i in range(2, max+1):
    fact.append(fact[-1] * i % mod)
    inv.append(-inv[mod % i] * (mod // i) % mod)
    factinv.append(factinv[-1] * inv[-1] % mod)

def cmb(n, r):
    if r < 0 or r > n:
        return 0
    else:
        r = min(r, n-r)
        return fact[n] * factinv[r] * factinv[n-r] % mod


"""
いよいよ本題。
まずは¥Sum_{0¥le i¥le x, 0¥le j¥le y} _{i+j}C_iを計算する。
実際今回の問題は容易にこれに帰着可能。

¥Sum_{0¥le i¥le x, 0¥le j¥le y} _{i+j}C_i
    = ¥Sum_i (¥Sum_j _{i+j}C_i)
    = ¥Sum_i {(T+1)^i + (T+1)^{i+1} + ... + (T+1)^{i+y})のT^iの係数}
    = ¥Sum_i {¥frac{(1+T)^{i+y+1} - (1+T)^i}{T}のT^iの係数}
    = ¥Sum_i _{i+y+1}C_{i+1}

    = ¥Sum_i _{i+y+1}C_y
    = _{y+1}C_y + _{y+2}C_y + ... + _{y+x+1}C_y
    = {(1+T)^{y+1} + (1+T)^{y+2} + ... (1+T)^{y+x+1}のT^yの係数}
    = {¥frac{(1+T)^{x+y+2} - (1+T)^{y+1}}{T}のT^yの係数}
    = _{x+y+2}C_{y+1} - 1
"""
r1, c1, r2, c2 = map(int, input().split())
a = cmb(r2+c2+2, c2+1) - 1
b = cmb(r1+c2+1, c2+1) - 1
c = cmb(r2+c1+1, r2+1) - 1
d = cmb(r1+c1, r1) - 1
ans = a - b - c + d
print(ans)


### FIXED CODE ###

import sys
input = sys.stdin.readline().rstrip

"""
まず一般に剰余込みでの組み合わせの計算。
n!, (n!)^{-1} mod pの値を配列にまとめておき、nCr = (n!)/(r!)((n-r)!)をO(1)で計算する。

max = (用意する配列の最大長)
mod = （剰余）

(n!)^{-1}の計算は¥Prod_i i^{-1}を計算して求める。
i^{-1} mod pの計算はフェルマーの小定理より、mod pにおいて
0 = p = (p // i) * i + (p % i)
0 = (p // i) + (p % i) * i^{-1}
i^{-1} = -(p // i) * (p % i)^{-1}
"""

max = 10**6 * 2 + 3 # ここでRE出しまくってた。。。
mod = 10**9+7
fact = [1, 1] # fact[n] = (n! mod p)
factinv = [1, 1] # factinv[n] = ((n!)^{-1} mod p)
inv = [0, 1] # inv[n] = (n^{-1} mod p)

for i in range(2, max+1):
    fact.append(fact[-1] * i % mod)
    inv.append(-inv[mod % i] * (mod // i) % mod)
    factinv.append(factinv[-1] * inv[-1] % mod)

def cmb(n, r):
    if r < 0 or r > n:
        return 0
    else:
        r = min(r, n-r)
        return fact[n] * factinv[r] * factinv[n-r] % mod


"""
いよいよ本題。
まずは¥Sum_{0¥le i¥le x, 0¥le j¥le y} _{i+j}C_iを計算する。
実際今回の問題は容易にこれに帰着可能。

¥Sum_{0¥le i¥le x, 0¥le j¥le y} _{i+j}C_i
    = ¥Sum_i (¥Sum_j _{i+j}C_i)
    = ¥Sum_i {(T+1)^i + (T+1)^{i+1} + ... + (T+1)^{i+y})のT^iの係数}
    = ¥Sum_i {¥frac{(1+T)^{i+y+1} - (1+T)^i}{T}のT^iの係数}
    = ¥Sum_i _{i+y+1}C_{i+1}

    = ¥Sum_i _{i+y+1}C_y
    = _{y+1}C_y + _{y+2}C_y + ... + _{y+x+1}C_y
    = {(1+T)^{y+1} + (1+T)^{y+2} + ... (1+T)^{y+x+1}のT^yの係数}
    = {¥frac{(1+T)^{x+y+2} - (1+T)^{y+1}}{T}のT^yの係数}
    = _{x+y+2}C_{y+1} - 1
"""
r1, c1, r2, c2 = map(int, input().split())
a = cmb(r2+c2+2, c2+1) - 1
b = cmb(r1+c2+1, c2+1) - 1
c = cmb(r2+c1+1, r2+1) - 1
d = cmb(r1+c1, r1) - 1
ans = a - b - c + d
print(ans % mod)
N,M = [int(i) for i in input().split()]
A = []
for _ in range(M):
    A.append(int(input()))
def fibo(n):
    if n <= 2:
        return n
    return fibo(n-1) + fibo(n-2)
cnt = 1
for a in range(len(A)+1):
    if a == 0:
        if A[a] == 1:
            width = 1
        else:
            width = A[a]-2
    elif a > 0 and a < M:
        width = A[a] - A[a-1] - 2
    elif a == (M):
        width = N-A[a-1]-1
    if width < 0:
        tmp = 0
        cnt = 0
        break
    else:
        tmp = fibo(width)
    cnt = (tmp*cnt)%1000000007
print(cnt)

### FIXED CODE ###

mod = 1000000007
N,M = [int(i) for i in input().split()]
A = []
for _ in range(M):
    A.append(int(input()))
steps = [0]*N
for a in A:
    steps[a-1] = 1
cnt = []
for n in range(N):
    if n == 0:
        if steps[n]==0:
            cnt.append(1)
        elif steps[n]==1:
            cnt.append(0)
    elif n == 1:
        if steps[n]==0:
            cnt.append(cnt[n-1]+1)
        elif steps[n]==1:
            cnt.append(0)
    elif steps[n] == 0:
        cnt.append((cnt[n-2]+cnt[n-1])%mod)
    elif steps[n] == 1:
        cnt.append(0)
print(cnt[-1])
A = list(str(input()))
B = list(str(input()))
C = list(str(input()))
a_len = len(A)
b_len = len(B)
c_len = len(C)
next = "A"

while a_len>=0 and b_len>=0 and c_len>=0:
    if next=="A":
        next = A[0].upper()
        A = A.pop(0)
        a_len = a_len - 1
    elif next=="B":
        next = B[0].upper()
        A = A.pop(0)
        b_len = b_len - 1
    else:
        next = C[0].upper()
        B = B.pop(0)
        c_len = c_len - 1
print(next)

### FIXED CODE ###

A = list(str(input()))
B = list(str(input()))
C = list(str(input()))
a_len = len(A)
b_len = len(B)
c_len = len(C)
next = "a"

while a_len>=0 and b_len>=0 and c_len>=0:
    if next=="a":
        if a_len>=1:
            next = A[0]
            del A[0]
        a_len -= 1
    elif next=="b":
        if b_len>=1:
            next = B[0]
            del B[0]
        b_len -= 1
    else:
        if c_len>=1:
            next = C[0]
            del C[0]
        c_len -= 1
print(next.upper())
print(int(input()) + int(input()) / 2)

### FIXED CODE ###

X, Y = [int(x) for x in input().split()]
print(X + Y // 2)
import sys
input = sys.stdin.readline
N = int(input())
a = tuple(map(int, input().split()))
b = tuple(map(int, input().split()))
dp = [0] * (N + 1)
res = 0
for i in range(N, -1, -1):
  for j in range(3):
    if a[j] < b[j] and (i - a[j] >= 0): dp[i - a[j]] = max(dp[i - a[j]], dp[i] + b[j])
  res = max(res, i + dp[i])
#print(res)
d = []
for i in range(3):
  if a[i] > b[i]: d.append((b[i], a[i]))
if len(d) == 0: print(res)
elif len(d) == 1:
  res = res // d[0][0] * d[0][1] + res % d[0][0]
  print(res)
elif len(d) == 2:
  dp = [0] * (res + 1)
  rres = 0
  for i in range(res, -1, -1):
    for x, y in d:
      if i - x >= 0: dp[i - x] = max(dp[i - y], dp[i] + y)
    rres = max(rres, i + dp[i])
  print(rres)
else:
  dp = [0] * (res + 1)
  rres = 0
  for i in range(res, -1, -1):
    for j in range(3):
      if a[j] > b[j] and (i - b[j] >= 0): dp[i - b[j]] = max(dp[i - b[j]], dp[i] + a[j])
    rres = max(rres, i + dp[i])
  print(rres)

### FIXED CODE ###

import sys
input = sys.stdin.readline
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d1 = []
d2 = []
for i in range(3):
  if a[i] < b[i]: d1.append((a[i], b[i]))
  if a[i] > b[i]: d2.append((b[i], a[i]))

dp = [0] * (N + 1)

for i in range(N, -1, -1):
  for t in d1:
    x = t[0]
    y = t[1]
    if i - x >= 0:
      dp[i - x] = max(dp[i - x], y + dp[i])
for i in range(N + 1): dp[i] += i

def calc(x, r1):
  z = r1 - d2[0][0] * x
  return (z // d2[1][0]) * d2[1][1] + z % d2[1][0] + d2[0][1] * x

res1 = max(dp)
if len(d2) == 0:
  print(res1)
if len(d2) == 1:
  x, y = d2.pop()
  print((res1 // x) * y + (res1 % x))
if len(d2) == 2:
  x0 = 0
  x3 = res1 // d2[0][0]
  res2 = res1 + 0
  for x in range(x0, x3 + 1):
    res2 = max(res2, calc(x, res1))
  print(res2)

if len(d2) == 3:
  dp2 = [0] * (res1 + 1)
  for i in range(res1, -1, -1):
    for t in d2:
      x = t[0]
      y = t[1]
      if i - x >= 0:
        dp2[i - x] = max(dp2[i - x], y + dp2[i])
  for i in range(res1 + 1): dp2[i] += i
  print(max(dp2))
A, B = map(int, input()split())

print(A* B)

### FIXED CODE ###

A, B = map(int, input().split())
     
print(A* B)
n=input()
a=0
for i in range(len(n)):
	if n[i]=="9":
    	a+=1
if a!=0:
	print("Yes")
else:
	print("No")

### FIXED CODE ###

n=input()
a=0
for i in range(len(n)):
    if n[i]=="9":
        a+=1
if a!=0:
    print("Yes")
else:
    print("No")
while True:
 h,w=map(int,input().split())
 if h==0:break
 print("".join(['#']*w))
 for _ in range(h-2):print("#".join(['.']*(w-2)))
 print("".join(['#']*w))
 print(\n)

### FIXED CODE ###

while 1:
 h,w=map(int,input().split())
 if h==0:break
 print(('#'*w)+'\n'+('#'+'.'*(w-2)+'#\n')*(h-2)+('#'*w)+'\n')
n, k, q = map(int,input().split())

A = [int(input()) for i in range(q)]

cntA = Counter(A)

for i in range(1, n +1):
    if (k - q + cntA[i] >= 1 ):
        print('Yes')
    else :
        print('No')

### FIXED CODE ###

from collections import deque, defaultdict, Counter

n, k, q = map(int,input().split())

A = [int(input()) for i in range(q)]

cntA = Counter(A)

for i in range(1, n +1):
    if (k - q + cntA[i] >= 1 ):
        print('Yes')
    else :
        print('No')
import math
n = int(input())
ans = math.factorial(10) / math.factorial(10 - (n-2))
print(ans % (10**9 + 7))

### FIXED CODE ###

n = int(input())
ans = 10**n - 9**n - 9**n + 8**n
print(ans % (10**9 + 7))
a, b, c, d, e, k = map(int, input().split())

if k >= (a - e):
    print('Yay!')
else:
    print(':(')

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e - a <= k:
    print('Yay!')
else:
    print(':(')
'''
	We can show that if u and v belong to the same connected component, then they are friends w/ each other
	So everyone in a given connected component is friends with one another
	So everyone in a given connected component must be separated into different groups

	If we have a CC of with sz nodes in it, then we need at least sz different groups

	So, the minimum number of groups needed is max sz(CC)
'''
n, m = map(int,input().split())
adj = [[] for u in range(n+1)]
for i in range(m):
	u, v = map(int,input().split())
	adj[u].append(v)
	adj[v].append(u)

vis = [False for u in range(n+1)]
def dfs(u):
	if vis[u]:
		return 0
	vis[u] = True

	sz = 1
	for v in adj[u]:
		sz += dfs(v)
	return sz

CCs = []
for u in range(1,n+1):
	if not vis[u]:
		CCs.append(dfs(u))

print(max(CCs))

### FIXED CODE ###

'''
	We can show that if u and v belong to the same connected component, then they are friends w/ each other
	So everyone in a given connected component is friends with one another
	So everyone in a given connected component must be separated into different groups

	If we have a CC of with sz nodes in it, then we need at least sz different groups

	So, the minimum number of groups needed is max sz(CC)
'''
n, m = map(int,input().split())
adj = [[] for u in range(n+1)]
for i in range(m):
	u, v = map(int,input().split())
	adj[u].append(v)
	adj[v].append(u)

vis = [False for u in range(n+1)]
def bfs(s):
	sz = 0
	queue = [s]
	ptr = 0
	
	while ptr < len(queue):
		u = queue[ptr]
		if not vis[u]:
			vis[u] = True
			sz += 1
			for v in adj[u]:
				queue.append(v) 
		ptr += 1

	return sz

CCs = []
for u in range(1,n+1):
	if not vis[u]:
		CCs.append(bfs(u))

print(max(CCs))
i=1
while input()!=0:
    print("Case " ,i,":",int(input()))
    i += 1



### FIXED CODE ###

i=1
while True:
    x = int(input())
    if x==0: break
    print("Case {0}: {1}".format(i,x))
    i += 1
a=list(map(int, input().split()))
l=[a[0]]
if a[0]==1:
    print(0)
    exit()
elif a[0]==0:
    print(0)
    exit()
elif a[1]==1:
    print(0)
    exit()
def d(a,b):
    if a<b:
        if min(l)>b-a:
            l.append(b-a)
            d(b-a,a)
        else:
            print(min(l))
            exit()
    elif b<a:
        if min(l)>a-b:
            l.append(a-b)
            d(a-b,b)
        else:
            print(min(l))
            exit()
    else:
        print(0)
        exit()
d(a[0],a[1])

### FIXED CODE ###

a=list(map(int, input().split()))
def d(a,b):
    _1=a%b
    _2=b-(a%b)
    if _1<_2:
        print(_1)
    else:
        print(_2)
d(a[0],a[1])
n = input()

for i in range(2**3):
    ss =""
    for j in range(3):
        ss +=n[j]
        if((i >> j )&1==True):
            ss += "+"
        else:
            ss += "-"
    ans = eval(ss)
    if (ans == 7):
        ss += "=7"
        print(ss)

### FIXED CODE ###

n = input()
for i in range(2**3):
    ss =""
    ss +=n[0]
    for j in range(3):
        if((i >> j )&1==True):
            ss += "+"
            ss += n[j+1]
        else:
            ss += "-"
            ss += n[j+1]
    ans = eval(ss)
    if (ans == 7):
        ss += "=7"
        print(ss)
        break
N, M = map(int, raw_input().split())
if (N+M) % 3 == 0:
	print  "Possible"
	return 0

if (N) % 3 == 0:
	print  "Possible"
	return 0

if (M) % 3 == 0:
	print  "Possible"
	return 0

print "Impossible"

### FIXED CODE ###

N, M = map(int, raw_input().split())
if (N+M) % 3 == 0:
	print  "Possible"

elif (N) % 3 == 0:
	print  "Possible"

elif (M) % 3 == 0:
	print  "Possible"

else:
	print "Impossible"
import numpy as np
N = int(input())
A = list(map(int,input().split()))

chofuku_dict = {}
chofuku = []

for a in A:
    if a not in chofuku_dict:
        chofuku_dict[a] = 1
    else:
        chofuku.append(a)
        
chofuku = set(chofuku)

A = list(set(A))
A.sort()

bl = np.array([0] + [1]*A[-1])
ans = 0
for a in A:
    if a in chofuku:
        continue
    if bl[a] == 1:
        bl[a] = 0
        ans += 1
        bl[2*a::a] = 0
print(ans)

### FIXED CODE ###

import numpy as np
N = int(input())
A = list(map(int,input().split()))

chofuku_dict = {}
chofuku = []

for a in A:
    if a not in chofuku_dict:
        chofuku_dict[a] = 1
    else:
        chofuku.append(a)
        
chofuku = set(chofuku)

A = list(set(A))
A.sort()

bl = np.array([0] + [1]*A[-1])

ans = 0
for a in A:
    if bl[a] == 0:
        continue
    if a not in chofuku:
        ans += 1
    bl[2*a::a] = 0
print(ans)
from collections import *
d=defaultdict(list)
n,m=map(int,input().split())
 
for s in range(m):
    a,b,c=map(int,input().split())
    d[a].append([b,c])
#print(d)

def BELLMANFORD(point,d):
    cost       = {node:-1e18 for node in range(1,n+1)}
    preference = {node:None         for node in range(1,n+1)}      #最適路のこと 
    cost[point]= 0
    for i in range(n-1):                                  #経路の長さは最大n-1であるため
        for now,lis in d.items():
            for nex,c in lis:
                if cost[nex]<cost[now]+c:
                    cost[nex]=cost[now]+c
                    preference[nex]=now
 
    negative=[0]*n                                        #負閉路の長さは最大nであるため
    
    for i in range(n):                  #閉路判定 negativeの1は閉路に入っている部分を表す
        for now,lis in d.items():
            for nex,c in lis:
                if negative[now-1]==1:
                    negative[nex-1]=1
                if cost[nex]<cost[now]+c:
                    cost[nex]=cost[now]+c
                    preference[nex]=now
                    negative[now-1]=1
 
    return cost,negative

x,y=(BELLMANFORD(1,d))
#print(x,y)
if y[n-1]==1:
    print("inf")
else:
    print(x[n])

### FIXED CODE ###

import sys
input=sys.stdin.readline  #危険！基本オフにしろ！


n,m,p=map(int,input().split())

d={}
for s in range(m):
    a,b,c=map(int,input().split())
    if a in d:
        d[a].append((b,c))
    else:
        d[a]=[(b,c)]

#print(d)


def BELLMANFORD(point,d,p):
    cost       = [-float("inf") for node in range(n+1)]  #infじゃないと閉路検出がうまくいかない
    cost[point]= 0
    for i in range(n-1):                                  #経路の長さは最大n-1であるため
        for now,lis in d.items():
            for nex,c in lis:
                if cost[nex]<cost[now]+c-p:
                    cost[nex]=cost[now]+c-p

    negative=[0]*n                                        #負閉路の長さは最大nであるため
    
    for i in range(n):                  #閉路判定 negativeの1は閉路に入っている部分を表す
        for now,lis in d.items():
            for nex,c in lis:
                if negative[now-1]==1:
                    negative[nex-1]=1
                if cost[nex]<cost[now]+c-p:
                    cost[nex]=cost[now]+c-p
                    negative[now-1]=1
 
    return cost,negative

def main():
    x,y=(BELLMANFORD(1,d,p))
    
    if y[n-1]==1:
        print(-1)
    else:
        print(max(x[n],0))

    
if __name__ == '__main__':
    main()
N = int(input())
li=[int(it) for it in input().split()]
lia=li[::2]
lib=li[1::2]

import collections
ca = list(collections.Counter(lia).items())
cb = list(collections.Counter(lib).items())
na = len(lia)
nb = len(lib)
ca.sort(key=lambda x:-x[1])
cb.sort(key=lambda x:-x[1])
s = 0
if ( ca[0][0] != cb[0][0] ):
  s += na - ca[0][1]
  s += nb - cb[0][1]
else:
  if ( ca[0][1] > cb[0][1]   ):
    s += na - ca[0][1]
    if ( len(cb)>1 ):
      s += nb - cb[1][1]
    else:
      s += nb
  elif (ca[0][1] < cb[0][1]) :
    s += nb - cb[0][1]
    if ( len(ca)>1 ):
      s += na - ca[1][1]
    else:
      s += na
  else:
    s += na + nb - max(cb[0][1]+ca[1][1],ca[0][1]+cb[1][1])
    
print (s)
  


### FIXED CODE ###

N = int(input())
li=[int(it) for it in input().split()]
lia=li[::2]
lib=li[1::2]

import collections
ca = list(collections.Counter(lia).items())
cb = list(collections.Counter(lib).items())
na = len(lia)
nb = len(lib)
ca.sort(key=lambda x:-x[1])
cb.sort(key=lambda x:-x[1])
s = 0
if ( ca[0][0] != cb[0][0] ):
  s += na - ca[0][1]
  s += nb - cb[0][1]
else:
  if ( ca[0][1] > cb[0][1]   ):
    s += na - ca[0][1]
    if ( len(cb)>1 ):
      s += nb - cb[1][1]
    else:
      s += nb
  elif (ca[0][1] < cb[0][1]) :
    s += nb - cb[0][1]
    if ( len(ca)>1 ):
      s += na - ca[1][1]
    else:
      s += na
  else:
    p1 = cb[0][1]
    p2 = ca[0][1]
    if (len(ca)>1):
      p1+=ca[1][1]
    if (len(cb)>1):
      p2+=cb[1][1]
    s += na + nb - max(p1,p2)
    
print (s)
r,d,x=map(int,input().split())

for i inrange(1,11):
  x=r*x-d
  print(x)

### FIXED CODE ###

r,d,x=map(int,input().split())

for i in range(1,11):
  x=r*x-d
  print(x)
n = int(input())
a = list(map(int,input().split()))
count = 0
su = sum[a]
for i in range(n-1):
	su -= a[i]
	count += a[i]*su
print(count%(10**9+7))

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
count = 0
su = sum(a)
for i in range(n-1):
	su -= a[i]
	count += a[i]*su
print(count%(10**9+7))
x = input()
y = input()

if x >= y:
    print(10)
else:
    print(0)

### FIXED CODE ###

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

if x >= y:
    print(10)
else:
    print(0)