Harryxun/stf_run huggingface dataset:
l, r = map(int, input().split( ))
ans = []
if r - l>=2019:
  print(0)
else:
  for i in range(l,r):
    for j in range(i+1,r+1):
      tmp = i*j%2019
      ans.append(tmp)
      
print(min(ans))

### FIXED CODE ###

l, r = map(int, input().split( ))
ans = []
if r - l>=2019:
    print(0)
else:
    for i in range(l,r):
        for j in range(i+1,r+1):
            tmp = i*j%2019
            ans.append(tmp)
    print(min(ans))
import sys
N, K = map(int, input().split())
s = input()
  
group = []
sign = s[0]
curr = 0
for i in range(N):
  curr += 1
  if s[i] != sign: 
    group += [curr-1]
    curr = 1
    sign = s[i]
else:group += [curr]

if s[0] == '0' :
  if s[N-1] == '0':
    m = (len(group)+1)//2
    if K >= m:
      print(N)
      sys.exit()
    score = [sum(group[:2*K])]
    for i in range(m-K):
      score += [score[-1] - group[2*i] + group[2*i+2*K]]
  else :
    m = (len(group)+1)//2
    if K >= m:
      print(N)
      sys.exit()
    score = [sum(group[:2*K])]
    for i in range(m-K):
      score += [score[-1] - group[2*i] + group[2*i+2*K]]
    score[-1] += group[-1]
else:
  0/0
  m = len(group)//2
  group += [0]
  if K >= m:
    print(N)
    sys.exit()
  score = [sum(group[:2*K+1])]
  for i in range(m-K):
    score += [score[-1] - group[2*i] - group[2*i+1] + group[2*i+2*K+1]+group[2*i+2*K +2]]

print(max(score))

### FIXED CODE ###

N, K = map(int, input().split())
s = input()
  
group = []
if s[0] == '0' :
  group = [0]
sign = s[0]
curr = 0
for i in range(N):
  curr += 1
  if s[i] != sign: 
    group += [curr-1]
    curr = 1
    sign = s[i]
else:group += [curr]
if s[-1] == '0':
  group += [0]

m = len(group)//2
if K >= m:
  print(N)
else:
  score = [sum(group[:2*K+1])]
  for i in range(m-K):
    score += [score[-1] - group[2*i]  - group[2*i+1] + group[2*i+2*K+1]+group[2*i+2*K+2]]
  
  print(max(score))
a, b, k = map(int, input().split())
arr = list(range(a, b+1))
for i in sorted(set(arr[:k]|arr[-k:])):
    print(i)

### FIXED CODE ###

a, b, k = map(int, input().split())
arr = range(a, b+1)
for i in sorted(set(arr[:k]) | set(arr[-k:])):
    print(i)
S = input()
w = input()
ans = ''

for i in range(0, len(S), w):
    lit = S[i:i+w]
    ans = ans + lit[0]

print(ans)

### FIXED CODE ###

S = input()
w = input()
w = int(w)
ans = ''

for i in range(0, len(S), w):
    lit = S[i:i+w]
    ans = ans + lit[0]

print(ans)
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
happiness = 0
memory = 100
for i in range(N):
  happiness += B[A[i]]
  if memory + 1 == A[i]:
    happiness += C[A[i]-1]
  memory = A[i]
print(happiness)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
happiness = 0
memory = 100
for i in range(N):
  happiness += B[A[i]-1]
  if memory + 1 == A[i]:
    happiness += C[A[i]-2]
  memory = A[i]
print(happiness)
import sys
sys.setrecursionlimit(100000)

n = int(input())
action = []
for i in range(n):
    action.append(list(map(int,input().split())))

def dp(i, a):
    if i == 0:
        return action[0][a]
    else:
        return max(dp(i-1, (a+1)%3), dp(i-1, (a+2)%3)) + action[i][a]

print(max([dp(n-1,a) for a in range(3)]))

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

n = int(input())
action = []
for i in range(n):
    action.append(list(map(int,input().split())))

memo = []
for i in range(n):
    memo.append([-1]*3)

def dp(i, a):
    if i == 0:
        return action[0][a]
    elif memo[i][a] != -1:
        return memo[i][a]
    else:
        memo[i][a] = max(dp(i-1, (a+1)%3), dp(i-1, (a+2)%3)) + action[i][a]
        return memo[i][a]

print(max([dp(n-1,a) for a in range(3)]))
def main():
    arr = []
    for i in range(3):
        arr.append(map(int, input().split()))
    b1 = arr[0][0] - arr[0][1]
    b2 = arr[0][1] - arr[0][2]
    a1 = arr[1][0] - arr[0][0]
    a2 = arr[2][0] - arr[1][0]
    for i in range(3):
        if arr[i][0] - arr[i][1] != b1 or arr[i][1] - arr[i][2] != b2 or arr[1][i] - arr[0][i] != a1 or arr[2][i] - \
                arr[1][i] != a2:
            print("No")
            return
    print("Yes")

if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    arr = []
    for i in range(3):
        arr.append(list(map(int, input().split())))
    b1 = arr[0][0] - arr[0][1]
    b2 = arr[0][1] - arr[0][2]
    a1 = arr[1][0] - arr[0][0]
    a2 = arr[2][0] - arr[1][0]
    for i in range(3):
        if arr[i][0] - arr[i][1] != b1 or arr[i][1] - arr[i][2] != b2 or arr[1][i] - arr[0][i] != a1 or arr[2][i] - \
                arr[1][i] != a2:
            print("No")
            return
    print("Yes")

if __name__ == '__main__':
    main()
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 998244353

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

#時間計測

def use_divisors(n):
    l_divisors, r_divisors = [], []
    for i in range(1, int(n**0.5)+1):
        if n%i == 0:
            if (n//i)%2:
                l_divisors.append(i)
            if i != n//i:
                if (n//(n//i))%2:
                    r_divisors.append(n//i)
    return l_divisors + r_divisors[::-1]
 
N = I()
X = str(input())
Xr = ''.join('1' if c=='0' else '0' for c in X)

divisors = use_divisors(2*N)
C = dict.fromkeys(divisors,0)

for d in divisors:
    T = X[:d//2]
    Tr = Xr[:d//2]
    Tc = T+Tr
    count = int(T,2)
    if Tc*(N//d)+Tc[:N-d*(N//d)] <= X:
    #    count += 1
    C[d] = count
    for d1 in divisors:
        if d%d1==0 and d!=d1:
            C[d] -= C[d1]

ans = 0
for d in divisors:
    ans += d*C[d]
    ans %= mod

print(ans)

### FIXED CODE ###

import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 998244353

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

def use_divisors(n):
    l_divisors, r_divisors = [], []
    for i in range(1, int(n**0.5)+1):
        if n%i == 0:
            if (n//i)%2:
                l_divisors.append(i)
            if i != n//i:
                if (n//(n//i))%2:
                    r_divisors.append(n//i)
    return l_divisors + r_divisors[::-1]
 
N = I()
X = str(input())
Xr = ''.join('1' if c=='0' else '0' for c in X)

ans = 0
divisors = use_divisors(2*N)
C = dict.fromkeys(divisors,0)

for d in divisors:
    T = X[:d//2]
    Tr = Xr[:d//2]
    Tc = T+Tr
    count = int(T,2)
    if int(Tc*(N//d)+Tc[:N-d*(N//d)],2) <= int(X,2):
        count += 1
    C[d] = count
    for d1 in divisors:
        if d%d1==0 and d!=d1:
            C[d] -= C[d1]

ans = 0
for d in divisors:
    ans += d*C[d]
    ans %= mod

print(ans)
import numpy as np
import copy

def main():
    l, r = map(int, input().split())
    
    ans_tmp = 2019
    if r-l >= 2019:
        ans_tmp = 0
    else:
        for j in range(r-l):
            for k in range(r-l-1):
                ans = ((l+j)*(l+(k+1)))% 2019
                if ans == 0:
                    ans_tmp = 0
                    break
                elif ans < ans_tmp:
                    ans_tmp = ans
                
        
    print(ans_tmp)

if __name__ == '__main__':
    main()



### FIXED CODE ###

import numpy as np
import copy

def main():
    l, r = map(int, input().split())
    
    ans_tmp = 2019
    if r-l >= 2019:
        ans_tmp = 0
    else:
        for j in range(r-l):
            for k in range(j,r-l):
                ans = ((l+j)*(l+(k+1)))% 2019
                if ans == 0:
                    ans_tmp = 0
                    break
                elif ans < ans_tmp:
                    ans_tmp = ans
                
        
    print(ans_tmp)

if __name__ == '__main__':
    main()
n,s=map(int,input().split())
mod=998244353
A=list(map(int,input().split()))
dp=[[]*(s+1) for i in range(n+1)]
dp[0][0]=[1]
for i in range(n+1):
  dp[i][0]=[1]
for i in range(1,n+1):
  for j in range(1,s+1):
    dp[i][j].append(dp[i-1][j])
    if j+A[i]<=s:
      dp[i][j+A[i]].append(dp[i][j]+1)
ans=0
for i in range(len(dp[n][s])):
  ans=ans+dp[n][s][i]*pow(2,n-dp[n][s][i],mod)
print(ans%mod)

### FIXED CODE ###

n,s=map(int,input().split())
A=list(map(int,input().split()))
mod=998244353
a=499122177
b=pow(2,n-1,mod)
dp=[[0]*(s+1) for i in range(n+1)]
for i in range(n+1):
  dp[0][0]=pow(2,n,mod)
for i in range(1,n+1):
  dp[i]=dp[i-1][0:s+1]
  for j in range(s+1):
    if j+A[i-1]>s:
      break
    dp[i][j+A[i-1]]=(dp[i-1][j+A[i-1]]+dp[i-1][j]*a)%mod
print(dp[-1][-1])
# -*- coding: utf-8 -*-

import sys

def prob_a(args):
    s = args[1]
    chars = list(s)
    tmpc = chars[0]
    for c in chars[1:]:
        if c == tmpc:
            continue
        else:
            print('Yes')
            return 0
    print('No')

if __name__ == '__main__':
    args = sys.argv
    prob_a(args)


### FIXED CODE ###

# -*- coding: utf-8 -*-

import sys

def prob_a(s):
    chars = list(s)
    tmpc = chars[0]
    for c in chars[1:]:
        if c == tmpc:
            continue
        else:
            print('Yes')
            return 0
    print('No')

if __name__ == '__main__':
    s = input()
    prob_a(s)
n = int(input())
a = list(map(int, input().split()))
q = int(input())
m = list(map(int, input().split()))

def main():
    for number in m:
        if solve(0, number):
            print('yes')
        else :
            print('no')

def solve(i, m):
    if m == 0:
        return 1

    if i >= n:
        return 0

    res = solve(i + 1, m) | solve(i + 1, m - a[i])
    return res

if __name__ == '__main__':
    main()



### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
q = int(input())
m = list(map(int, input().split()))

def main():
    for number in m:
        if solve(0, number):
            print('yes')
        else :
            print('no')

def memolize(f):
    cache = {}

    def helper(x, y):
        if (x, y) not in cache:
            cache[(x, y)] = f(x, y)
        return cache[(x, y)]
    return helper

@memolize
def solve(i, m):
    if m == 0:
        return True

    if i >= n:
        return False

    res = solve(i + 1, m) or solve(i + 1, m - a[i])
    return res

if __name__ == '__main__':
    main()
N = int(input())
hs = list(map(int, input().split()))

costs_1 = 0
costs_2 = abs(hs[1] - hs[0])
for i in range(2, N):
  costs1, costs2 = min(costs1 + abs(hs[i] - hs[i - 2]), costs2 + abs(hs[i] - hs[i - 1])), costs1
  
print(costs2)


### FIXED CODE ###

N = int(input())
hs = list(map(int, input().split()))

costs1 = 0
costs2 = abs(hs[1] - hs[0])
for i in range(2, N):
  costs1, costs2 = costs2, min(costs1 + abs(hs[i] - hs[i - 2]), costs2 + abs(hs[i] - hs[i - 1])),
  
print(costs2)
import numpy as np
N, M = map(int, input().split())
if M == 1:
    A = int(input())
else:
    A = np.array([int(input()) for _ in range(M)], dtype = int)

MOD= 1000000007
dp = np.zeros(N, dtype = int)
dp[A - 1] = - 1
if dp[0] == -1 and dp[1] == -1:
    pass
elif dp[0] == -1:
    dp[1] = 1
elif dp[1] == -1:
    dp[0] = 1
else:
    dp[0] = 1; dp[1] = 2;


# if N >= 3:
#     for n in range(2, N):
#         if dp[n] != -1:
#             dp[n] = (max(dp[n-1], 0) + max(dp[n-2], 0)) % MOD

print (dp[-1])


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
import numpy as np
N, M = map(int, input().split())

MOD = 1000000007
dp = np.zeros(N, dtype = int)
if M != 0:
    A = np.array([int(input()) for _ in range(M)], dtype = int)
    dp[A - 1] = -1


if dp[0] == -1 and dp[1] == -1:
    pass
else:
    if dp[0] == -1:
        dp[1] = 1
    elif N >= 2 and dp[1] == -1:
        dp[0] = 1
    elif N >= 2:
        dp[0] = 1
        dp[1] = 2
    else:
        dp[0] = 1


if N >= 3:
    for n in range(2, N):
        if dp[n] != -1:
            dp[n] = (max(dp[n-1], 0) + max(dp[n-2], 0)) % MOD

print (dp[-1])
import sys
readline = sys.stdin.buffer.readline
read = sys.stdin.read
from collections import deque
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    N, K = map(int, readline().split())
    A = list(map(int, readline().split()))
    plus = False
    for a in A:
        if a>0:
            plus = True
            break


    if K%2==1 and plus==False:
        A.sort(reverse=True)
        ans = 1
        for i in minus[:K]:
            ans *= i % MOD
        ans %= MOD
    else:
        A.sort(reverse=True)
        A = deque(A)
        ans = 1
        if K%2==1:
            ans *= A.popleft()
        for _ in range(K//2):
            if A[0]*A[1]>=A[-1]*A[-2]:
                ans *= A.popleft()*A.popleft()%MOD
            else:
                ans *= A.pop() * A.pop() % MOD
        ans %= MOD

    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
readline = sys.stdin.buffer.readline
read = sys.stdin.read
from collections import deque
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    n, k = map(int, readline().split())
    A = list(map(int, readline().split()))
    MOD = int(1e9) + 7
    A.sort()
    ans = 1
    if A[n - 1] == 0 and (k & 1):
        ans = 0
    elif A[n - 1] <= 0 and (k & 1):
        for i in range(n - 1, n - k - 1, -1):
            ans = (ans * A[i]) % MOD
    else:
        i = 0
        j = n - 1
        if k & 1:
            ans = (ans * A[j]) % MOD
            j -= 1
            k -= 1
        k >>= 1
        for itr in range(k):
            left_product = A[i] * A[i + 1]
            right_product = A[j] * A[j - 1]
            if left_product > right_product:
                ans = (ans * left_product) % MOD
                i += 2
            else:
                ans = (ans * right_product) % MOD
                j -= 2

    print(ans % MOD)

if __name__ == '__main__':
    main()
x,y = map(int, input().split())
count = 0

if y >= 2*x and y <= 4*x and y % 2 == 0:
    print('Yes')
else:
    print('No') 


### FIXED CODE ###

S = input()
if S == 'ABC':
    print("ARC")
elif S == 'ARC':
    print('ABC')
A, B = map(int, input().split())
if B % A =0:
    print(A + B)
else:
    print(B - A)

### FIXED CODE ###

A, B = map(int, input().split())
if B % A ==0:
    print(A + B)
else:
    print(B - A)
s = input()
ans = 0

def reverse(s,i):
  if s[i] == 'B' and s[i+1] == 'B':
	s[i] = 'W'
	s[i+1] = 'B'
    ans += 1
  
while True:
  s = ans
  for i in range(len(s) - 1):
    reverse(s,i)
  if s == ans:
    print(ans)
    break

### FIXED CODE ###

s = input()
w = 0
b = 0
wa = 0
ba = 0
l = len(s)
 
for i in range(l):
  if s[i] == 'W':
    wa += i - w
    w += 1
  if s[-1-i] == 'B':
    ba += i - b
    b += 1
    
print(min(ba, wa))
X, N= map(int,input().split())
P = map(int, input().split())

P_sub_abs = [abs(i - X) for i in P]
if(P_sub_abs.count(0) == 0):
    print(X)
    exit()
for i in range(1, 100):
    if(P_sub_abs.count(i) == 1):
        list = [X - i, X + i]
        list.remove(P[P_sub_abs.index(i)])
        print(list[0])
        exit()
    elif(P_sub_abs.count(i) == 0):
        print(X - i)
        exit()


### FIXED CODE ###

X, N= [int(x) for x in input().split()]
P = [int(x) for x in input().split()]

P_sub_abs = [abs(i - X) for i in P]
if(P_sub_abs.count(0) == 0):
    print(X)
    exit()
for i in range(1, 100):
    if(P_sub_abs.count(i) == 1):
        list = [X - i, X + i]
        list.remove(P[P_sub_abs.index(i)])
        print(list[0])
        exit()
    elif(P_sub_abs.count(i) == 0):
        print(X - i)
        exit()
#import numpy as np

n = int(input())
a_s = list(map(int, input().split()))

n = 3
a_s =[1,0,0]

m = 0
ans = [0]*(n+1)
#ans = np.zeros(n+1).astype(int)


i=1
for i in range(n,0,-1):
    sum_num = 0
    for j in range(i,n+1,i):
        sum_num += ans[j]

    if((sum_num & 1) != a_s[i-1]):
        m += 1
        ans[i] = 1

ans2 = []
for i in range(1,n+1):
    if ans[i]==1:
        ans2.append(i)

print(m)
print(' '.join(map(str,ans2[])))


### FIXED CODE ###

#import numpy as np

n = int(input())
a_s = list(map(int, input().split()))

m = 0
ans = [0]*(n+1)
#ans = np.zeros(n+1).astype(int)


i=1
for i in range(n,0,-1):
    sum_num = 0
    for j in range(i,n+1,i):
        sum_num += ans[j]

    if((sum_num & 1) != a_s[i-1]):
        m += 1
        ans[i] = 1

ans2 = []
for i in range(1,n+1):
    if ans[i]==1:
        ans2.append(i)

print(m)
print(' '.join(map(str,ans2)))
x = list(map(int,input().split()))

while x[1] != 0 and x[2] != 0:
    x.sort()
    print(x[1],x[2])
    x = list(map(int, input().split)


### FIXED CODE ###

while True :
    x, y = sorted(map(int, input().split()))
    if x == y and y == 0 : break
    print(x, y)
N =int(input())
oppai=0

for i in range(1,N):
  if len(str(i))%2=1:
    oppai +=1

print(oppai)

### FIXED CODE ###

N =int(input())
oppai=0

for i in range(1,N+1):
  if len(str(i))%2 == 1:
    oppai +=1

print(oppai)
N = input()
if N == 2:
	A = int(input())
  	B = int(input())
    print(A+B)
else:
  	print('Hello World')

### FIXED CODE ###

N = int(input())
if N == 2:
  A = int(input())
  B = int(input())
  print(A + B)
elif N == 1:
  print('Hello World')
A,B,C,X,Y=map(int,input().split())

def dp(num_a,num_b,num_ab_a,num_ab_b):
    if num_a<=0 and num_b<=0:return 0
    elif num_b!=0:
        return min(B+dp(num_a,num_b-1,num_ab_a,num_ab_b),C*2+dp(num_a-1,num_b-1,num_ab_a,num_ab_b))
    else:
        return min(A+dp(num_a-1,num_b,num_ab_a,num_ab_b),C*2+dp(num_a-1,num_b-1,num_ab_a,num_ab_b))
print(dp(X,Y,0,0))

### FIXED CODE ###

A,B,C,X,Y=map(int,input().split())

def dp(num_a,num_b):
    """
    if num_a<=0 and num_b<=0:return 0
    elif num_b>0:
        if B<2*C:return B+dp(num_a,num_b-1)
        else :return C*2+dp(num_a-1,num_b-1)
    else:
        if A<2*C:return A+dp(num_a-1,num_b)
        else: return C*2+dp(num_a-1,num_b-1)
    """
    if A+B>2*C:
        if min(num_a,num_b)>0:
            if num_a > num_b:
                return num_b*2*C+dp(num_a-num_b,0)
            else :
                return num_a*2*C+dp(0,num_b-num_a)
        elif num_a==0 and num_b>0:
            if B<2*C:
                return num_b*B
            else :
                return C*2*num_b
        elif num_a>0 and num_b==0:
            if A<2*C:
                return A*num_a
            else :
                return 2*C*num_a
        else :
            return 0
    else :
        return num_a*A+num_b*B
print(dp(X,Y))
while true:
    H,W = [int(i) for i in input().split("")]
    if H == W == 0:
        break
        print ("#"*(W)
        for h in range(W-2):
            print ("."*(W-2).join("#","#"))
        print ("#"*(W))
        print ()

### FIXED CODE ###

while True:
    h,w = tuple([int(x) for x in raw_input().split(" ")])
    if h==0 and w==0: break
 
    for ih in range(h):
        if ih==0 or ih==h-1 or w <= 2: print "#" * w
        else: print "#" + "." * (w-2) + "#"
 
    print ""
A,B = int(input())
if B%A==0:
    print(A+B)
else:
    print(B-A)

### FIXED CODE ###

A,B = list(map(int,input().split()))
if B%A==0:
    print(A+B)
else:
    print(B-A)
#x = [int(x) for x in input().split()]
x = int(input())
y = int(input())
z = [1,2,3]
del(z.index(x))
del(z.index(y))
print(z[0])

### FIXED CODE ###

#x = [int(x) for x in input().split()]
x = int(input())
y = int(input())
z = [1,2,3]
del(z[z.index(x)])
del(z[z.index(y)])
print(z[0])
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

prime = [True] * (10**6 + 2)
prime[1] = False
max_range = int(math.sqrt(10**6)) + 1

for i in range(2, 10**6 + 1):
    if not prime[i]:
        continue
    if prime[i]:
        num = i + i
        while num < max_range:
            prime[num] = False
            num += i

def main():
    gcd = fractions.gcd
    A, B = LI()
    m = gcd(A, B)
    cnt = 1
    for i in range(2, m + 1):
        # print('i: ', i, ' prime[i]: ', prime[i])
        if not prime[i]:
            continue
        if m % i == 0:
            cnt += 1
    print(cnt)
main()



### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

def integer_factorization(n):
    prime_count = collections.Counter()
    for i in range(2, int(math.sqrt(n)) + 2):
        while n % i == 0:
            n //= i
            prime_count[i] += 1
    if n > 1:
        prime_count[n] += 1
    return prime_count

prime = [True] * (10**6 + 2)
prime[1] = False
max_range = int(math.sqrt(10**6)) + 1

for i in range(2, 10**6 + 1):
    if not prime[i]:
        continue
    if prime[i]:
        num = i + i
        while num < max_range:
            prime[num] = False
            num += i

def main():
    gcd = fractions.gcd
    A, B = LI()
    m = gcd(A, B)
    cnt = 1
    cnt += len(integer_factorization(m))
    # for i in range(2, int(math.sqrt(m)) + 1):
    #     if m % i != 0:
    #         continue
    #     if prime[i]:
    #         cnt += 1
    print(cnt)
main()
n = int(input())
a = []
ans = 0
for i in range(n):
    a.append(int(input()))
set_a = set(a)
for i in set_a:
    ans += a.count(i) % 2
print(ans)

### FIXED CODE ###

a = list(input())
if "9" in a:
    print("Yes")
else:
    print("No")
import sys
import math

dp = None
A = []

def lcm(a, b):
    return a * b // math.gcd(a, b)

def f(m):
    ans = 0
    for a in A:
        ans += m % a
    return ans

def main():
    global A

    N = int(input())
    A = [int(_) for _ in input().split()]

    lcmtemp = 1

    for a in A:
        lcmtemp = lcm(lcmtemp, a)

    print(f(lcmtemp-1))

main()


### FIXED CODE ###

import sys
import fractions

dp = None
A = []

def lcm(a, b):
    return a * b // fractions.gcd(a, b)

def f(m):
    ans = 0
    for a in A:
        ans += m % a
    return ans

def main():
    global A

    N = int(input())
    A = [int(_) for _ in input().split()]

    lcmtemp = 1

    for a in A:
        lcmtemp = lcm(lcmtemp, a)

    print(f(lcmtemp-1))

main()
x = list(map(int, input().split()))

c=0
for i in x:
    c =c+1
    if i == 0:
        ans = c
    else:
        ans -0

print(ans)

### FIXED CODE ###


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

c=0
for i in x:
    c =c+1
    if i == 0:
        ans = c


print(ans)