peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
d, n = map(int, input().split())
if d==0:
  if n == 100:
    ans = 101
  else:
    ans = n
elif d==1:
  if n == 100:
    ans = 10100
  else:
    ans = n*100
elif d==2:
  if n == 100:
    ans = 1010000
  else:
    ans = n*10000
print(ans)
# Judge status: Accepted

N =int(input())



print(int(N*(N-1)//2))
# Judge status: Accepted
n,m = map(int,input().split())

edge = [[] for _ in range(n)]

for _ in range(m):
    a,b = map(int,input().split())
    a,b = a-1,b-1

    edge[a].append(b)
    edge[b].append(a)


from collections import deque

d = deque([0])

dist = [-1]*n
dist[0] = 0

while d:
    v = d.popleft()

    for w in edge[v]:
        if dist[w]==-1:
            dist[w]=dist[v]+1
            d.append(w)

 
if dist[-1]==2:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
# Judge status: Accepted
l = input().split(" ")
n = int(l[0])
m = int(l[1])

r = []
l = []

for i in range(m):
    gatei = input().split(" ")
    li = int(gatei[0])
    ri = int(gatei[1])
    l.append(li)
    r.append(ri)

l.sort()
r.sort()

count = r[0] - l[m-1] + 1

if count >= 0:
    print(count)
else:
    print(0)
# Judge status: Wrong Answer
s = input()
week = ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]
for i in range(7):
    if s == week[i]:
        print(6-i)
# Judge status: Accepted
import collections
n, p = list(map(int, input().split()))
a = list(map(int, input().split()))
a2 = [ai%2 for ai in a]
a2 = collections.Counter(a2)

if a2[1] == 0:
  print(2 ** n if p == 0 else 0)
else:
  print( 2 ** (n-1))
# Judge status: Wrong Answer
N = int(input())
count = 0
for x in range(1, N+1):
    if x%3==0 or x%5==0:
       count=count+x
print(count)
# Judge status: Accepted
A,B = map(int,input().split())
print(A*B if (A<10 and B<10) else -1)
# Judge status: Wrong Answer

s=input()
flg = 0
cnt = 0
if s[1] == "S":
    flg = 1
for i in range(3):
    if s[i] == "S":
        cnt += 1
print(cnt if flg == 1 else cnt -1)
# Judge status: Accepted
from math import sqrt
n, d = map(int, input().split())
c = 0
for i in range (n):
    m,p = map(int, input().split())
    c += sqrt(m**2 + p**2) <= d
print(c)
# Judge status: Accepted
N = int(input())
A = map(int, input().split())

sortA = sorted(A)

result = 0
for i in range(1, N):
    result += sortA[N - (i // 2) - 1]

print(result)
# Judge status: Accepted
K, X = map(int, input().split())

min_x = max(X-(K-1), -1000000)
max_x = min(X+(K-1), 1000000)

ans = list(range(min_x, max_x+1))

print(*ans)
# Judge status: Wrong Answer
a, b, k = map(int,input().split())
ans = []
for i in range(k):
    if a <= a+i <= b:
        ans.append(str(a+i))
    if a <= b-i <= b:
        ans.append(str(b-i))
for i in (sorted(set(ans))):
    print(i)
# Judge status: Wrong Answer
N = input()
s1 = N[1:len(N)]
s2 = N[0:len(N) - 1]
isOk = True
for i in range(1, len(N)-1):
    if s1[i] != s1[i - 1]:
        break
        isOk = False
    else:
        continue

if isOk:
    print('Yes')
    exit(0)

isOk = True
for i in range(1, len(N)-1):
    if s2[i] != s2[i - 1]:
        break
        isOk = False
    else:
        continue

if isOk:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
lst = []
for i in range(3):
  l = list(map(int, input().split()))
  lst.append(l)
for i in range(1, 3):
  diff = lst[i][0] - lst[0][0]
  for j in range(3):
    lst[i][j] -= diff
  if lst[i] != lst[0]:
    print('No')
    exit()
print('Yes')
# Judge status: Wrong Answer
s = list(map(int, input()))
for i in range(1,4):
  if s[i]==s[i-1]:
    print('Bad')
    exit()
print('Yes')
# Judge status: Wrong Answer
n, m = map(int, input().split())

import math
#x = math.ceil((m-2*n)/4)
if m >= 2*n:
    x = math.ceil((m-2*n)/4)
    y = math.floor((m-2*n)/4)
    ans = max(n+y, (m-2*x)//2)
    print(ans)
else:
    print(n)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

from collections import Counter

A_=Counter(A)
A_.most_common()

Rectangle = [_ for _ in A_.keys() if A_[_] >1]
sq_list=[_ for _ in A_.keys() if A_[_] >= 4]

Rectangle.sort()
sq_list.sort()

ans=0

if len(Rectangle) >= 2:
    a_1 = Rectangle[-1]
    a_2 = Rectangle[-2]
    ans = a_1*a_2
    
if len(sq_list) >= 1:
    s_1 = sq_list[-1]
    if ans < s_1**2:
        ans=s_1**2

print(ans)
# Judge status: Accepted
def main():
  N=input()
  A=sorted(map(int,input().split()))
  M=A[-1]+1
  B=[True]*M
  c=0
  x=0
  for i in A:
    if B[i]:
      if i!=c:
        for j in range(i*2,M,i):
          B[j]=False
        x+=1
        c=i
      else:
        B[i]=False
        x-=1
  print(x)
main()
# Judge status: Accepted
n,a,b,c,d = map(int,input().split())
s = list(input())
s.insert(0,0)
for i in range(a,max(c,d)):
    if '#' == s[i] and '#' == s[i+1]:
        print('No')
        exit(0)
if c < d:
    print('Yes')
else:
    for i in range(b-1,d):
        if '.' == s[i] and '.' == s[i+1] and '.' == s[i+2]:
            print('Yes')
            exit(0)
    print('No')
# Judge status: Accepted
n,m=map(int,input().split())
a=[0]*(m+1)
mod=1000000007
for i in range(m):
    a[i]=int(input())
s=[1,1]
j=0
for i in range(2,n+1):
    if i-1==a[j]:
        s[i-1]=0
        j+=1
    s.append(s[i-1]+s[i-2])

print(s[n]%mod)
# Judge status: Accepted
X = int(input())

ans = 0
for b in range(1, X + 1):
    p = 2
    while b ** p <= X:
        ans = max(ans, b ** p)
        if b == 1: break
        p += 1

print(ans)
# Judge status: Wrong Answer
def resolve():
    '''
    code here
    '''
    a,b = [int(item) for item in input().split()]

    if a > 0:
        print('Positive')
    else:
        if a <= 0 and b >= 0 or a == b:
            print('Zero')
        else:
            cnt = a - b

            if cnt % 2 == 1:
                print('Posivite')
            else:
                print('Negative')

if __name__ == "__main__":
    resolve()
# Judge status: Wrong Answer
n=int(input())
word={}
for i in range(n):
    new=input()
    if new in word:
        word[new]+=1
    else:
        word[new]=1
m=int(input())
for i in range(m):
    new=input()
    if new in word:
        word[new]-=1
    else:
        word[new]=-1
        
print(max(word.values()))
# Judge status: Accepted
input_num = input()
number = int(input_num)
target = number
while 1:
    count = 0
    for i in range(target+1):
        if i == 0:
            continue
        if target%i == 0:
            count += 1
    if count == 2:
        break
    target += 1

print(target)
# Judge status: Accepted
S =input().strip()

def check(i, j):
    if S[i] == S[j]:
        return True
    return False

if check(2,3) and check(4,5):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a, b, c = sorted([int(i)for i in input().split()])
ans = 0
ma, mb, mc = [a % 2, b % 2, c % 2]

if ma == mb == mc:
    pass
elif ma != mb and mb == mc:
    b += 1
    c += 1
    ans += 1
elif ma == mc and ma != mb:
    a += 1
    c += 1
    ans += 1
elif ma == mb and mb != mc:
    a += 1
    b += 1
    ans += 1

ans += (c - b) // 2
ans += (c - a) // 2

print(ans)
# Judge status: Accepted
import fractions

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

ans = a_list[0]
for i in range(1, n):
    ans = ans * a_list[i] // fractions.gcd(ans, a_list[i])

num = 0
for a in a_list:
    num += ans//a

print(num%1000000007)
# Judge status: Accepted
N,x = map(int,input().split())
a = list(map(int,input().split()))

res = 0
if a[0]>x:
    res = a[0]-x
    a[0] = x
for i in range(1,N):
    tmp = a[i]+a[i-1]-x
    if tmp > 0:
        a[i] -= tmp
        res += tmp
print(res)
# Judge status: Accepted
from math import factorial

def combi(n, k):
  return factorial(n) // factorial(n-k) // factorial(k)

N, P = map(int, input().split())
A = list(map(int,input().split()))

e = len([a for a in A if a % 2 == 0])
o = N - e

ans = 0
for i in range(P, o+1, 2):
  ans += combi(o, i)
print(ans * pow(2, e))
# Judge status: Wrong Answer
N = int(input())

count = 0
for x in range(1, int(N/2+2)):
    for y in range(1, int(N/2+2)):
        if x * y < N:
            count += 1
        else:
            break

print(count)
# Judge status: Wrong Answer
S = input()
leng = len(S)
ans = 0
for i in range(leng, 1, -1):
    if S[:(i // 2)] == S[i // 2:i]:
        ans = i
print(ans)
# Judge status: Wrong Answer
w, a, b = map(int, input().split())

print(b-(w+a))
# Judge status: Wrong Answer
Q, H, S, D = list(map(int, input().split()))
Q *= 8
H *= 4
S *= 2
A = min(Q, H, S, D)
B = min(Q, H, S)
N = int(input())

print(int(N/2*A+N%2*B))
# Judge status: Accepted
import math
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=sum(b)-sum(a)
d=0
for i in range(n):
 if a[i]>b[i]:d+=a[i]-b[i]
 elif a[i]%2!=b[i]%2:d+=1
print("No"if c<d else"Yes")
# Judge status: Accepted
List=[int(input()) for i in range(6)]
if abs(List[0]-List[4])<=List[5]:
  print('Yay!')
else:
  print(':(')
# Judge status: Accepted
N_List = sorted(list(map(int,input().split())))
cnt = 0
if N_List[0] + 2 <= N_List[2]:
    cnt += (N_List[2] - N_List[0])//2
    N_List[0] += ((N_List[2] - N_List[0])//2) * 2

if N_List[1] + 2 <= N_List[2]:
    cnt += (N_List[2] - N_List[1])//2
    N_List[1] += ((N_List[2] - N_List[1])//2) * 2

if N_List.count(max(N_List)) == 2:
    cnt += 2
elif N_List.count(max(N_List)) == 1:
    cnt += 1
else:
    cnt += 0
print(cnt)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

dp = [0]*(10**6 + 1)
ans = 0

for i in a:
    if dp[i] == 0:
        for j in range(1,10**6+1):
            if i * j > 10**6:
                break
            dp[i*j] += 1
    elif dp[i] == 1:
        dp[i] += 1

for i in a:
    if dp[i] == 1:
        ans += 1


print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
if m <= n:
    print(0)
else:
    length = abs(x[0]-x[-1])
    abs_x = [0]*(m-1)
    for i in range(m-1):
        abs_x[i] = abs(x[i+1] - x[i])
    abs_x.sort(reverse=True)
    for i in range(n-1):
        length -= abs_x[i]
    print(length)
# Judge status: Accepted
n = int(input())
t,a = map(int,input().split())
li = list(map(int,input().split()))
for i in range(n):
    li[i] = abs(a - (t - li[i]*0.006))
print(int(li.index(min(li)))+1)
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1,n+1,2):
	cnt = 0
	for j in range(1,i+1):
		cnt += (i%j==0)
	if cnt==8: ans+=1
print(ans)
# Judge status: Accepted
d,t,s = map(int,input().split())

if t >= d/s:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
x,y=map(int, input().split())
import math
k=int(math.log2(y/x))+1
print(k)
# Judge status: Accepted
def main():
    n = int(input())
    A, B = [None]*n, [None]*n
    for i in range(n):
        A[i], B[i] = map(int, input().split())
    A.sort()
    B.sort()
    if n%2 == 0:
        p = (A[n//2-1] + A[n//2])/2
        q = (B[n//2-1] + B[n//2])/2
        print(int((q-p+0.5)*2))
    else:
        print(B[n//2] - A[n//2] + 1)

if __name__ == "__main__":
    main()
# Judge status: Accepted
n = int(input())
a = input().split()
even = []
even_counter = 0
div = 0

for i in a:
  int_a = int(i)
  if int_a % 2 == 0:
    even.append(int_a)
    even_counter += 1

for i in range(even_counter):
  if int(even[i]) % 3 == 0 or int(even[i]) % 5 == 0:
    div += 1

if div == even_counter:
  print("APPROVED")
else:
  print("DENIED")
# Judge status: Wrong Answer
import scipy.misc
n,p = map(int,input().split())
ai = [int(i)%2 for i in input().split()]

zero = ai.count(0)
one = ai.count(1)


tmp = 2**zero
ans = 0
for i in range(one//2+1):
    if p == 0:
        if i*2 > one:
            break
        ans += scipy.misc.comb(one,0+i*2)
    else:
        if i*2+1 > one:
            break
        ans += scipy.misc.comb(one,1+i*2)
print(int(ans*tmp))
# Judge status: Wrong Answer
N, K = map(int,input().split())
h = list(map(int,input().split()))

dp = [10000000]*(N)
dp[0]=0
for i in range(0,N):
  for j in range(0,K+1):
    if i+j<N: 
    	dp[i+j]=min(dp[i+j],dp[i]+abs(h[i+j]-h[i]))
  
print(dp[-1])
# Judge status: Accepted
import numpy as np

n,m,x = map(int,input().split())
arr = np.array([list(map(int,input().split())) for i in range(n)])
c = arr.T[0]
a = arr.T[1:].T

ans = np.inf
for i in range(2**n):
    ability = np.zeros(m, np.int64)
    cost = 0
    for j in range(n):
        if (i>>j)&1: ability += a[j] ; cost += c[j]
    if np.all(ability>=x): ans = min(ans,cost)

ans = -1 if ans==np.inf else ans
print(ans)
# Judge status: Accepted
# 2020/05/30
# NOMURA プログラミングコンテスト 2020 - A

# Input
h1, m1, h2, m2, k = map(int,input().split())

# Calc
hm1 = h1 * 60 + m1
hm2 = h2 * 60 + m2
ans = hm2 - hm1 - k

# Output
print(ans)
# Judge status: Wrong Answer
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
m = max(a)
for i in range(n):
  if a[i] != m:
    print(m)
  else:
    print(max(a[:i],a[i+1:])[0])
# Judge status: Accepted
X = int(input())

if X in range(400,600):
  print(8)
elif X in range(600,800):
  print(7)
elif X in range(800,1000):
  print(6)
elif X in range(1000,1200):
  print(5)
elif X in range(1200,1400):
  print(4)
elif X in range(1400,1600):
  print(3)
elif X in range(1600,1800):
  print(2)
else:
  print(1)
# Judge status: Accepted
N,M = map(int,input().split())
XY = [tuple(map(int,input().split())) for i in range(M)]

may_red = [0] * N
may_red[0] = 1
balls = [1] * N

for x,y in XY:
    x,y = x-1,y-1
    if may_red[x]:
        may_red[y] = 1
        if balls[x] == 1:
            may_red[x] = 0
    balls[x] -= 1
    balls[y] += 1
print(sum(may_red))
# Judge status: Wrong Answer
N, K = map(int,input().split())

ans = 0
for i in range(10**9):
    if K**i < N:
        i = i + 1
    else:
        ans = i
        break
        
print(ans)
# Judge status: Wrong Answer
x, y = map(int,input().split())
z =-2
for i in range(x):
    if i % 2 == 0:
        z +=4
    else:
        z +=2
if z == y or z == (y-2):
        print("Yes")
elif z!=y :
        print("No")
# Judge status: Accepted
n = int(input())
ans = 10**15
for i in range(1, n):
    if n % i == 0:
        ans = min(ans, n // i - 1 + i - 1)
    if i * i > n:
        break
print(ans)
# Judge status: Accepted
n = int(input())
ans = 0
ls = {}
for _ in range(n):
    s = ''.join(sorted(input()))
    if s in ls:
        ans += ls[s]
        ls[s] += 1
    else:
        ls[s] = 1
print(ans)
# Judge status: Wrong Answer
r = int(input())
if 0 <= r <= 100:
    length = r * 3.1415926535
    print(length)
# Judge status: Accepted
N=int(input())
A=list(map(int, input().split()))

ans=0
uf=False
lf=False
pre=A[0]
for i in range(1,N):
  if pre==A[i]:
    continue
  
  if A[i]>pre:
    uf=True
    if lf:
      ans+=1
      uf=False
      lf=False
  else:
    lf=True
    if uf:
      ans+=1
      uf=False
      lf=False
  pre=A[i]

print(ans+1)
# Judge status: Wrong Answer
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
print ("Yay!") if e-k <= k else print (":(")
# Judge status: Wrong Answer
t=[0,1]
for i in range(2,90):
  t.append(t[i-1]+t[i-2])
print(t[int(input())])
# Judge status: Accepted
n, h =map(int, input().split())
A=[]
B=[]
w=0
sub=0
for i in range(n):
	a,b=map(int, input().split())
	A.append(a)
	B.append(b)
	w=max(a,w)

ans=0
B.sort(reverse=True)
for i in range(n):
	if B[i]>w:
		h-=B[i]
		ans+=1
		if 1>h:
			print(ans)
			exit()
ans+=h//w
if h%w==0:
	print(ans)
else:
	print(ans+1)
# Judge status: Accepted
N=int(input())
S=list(map(int,input().split()))

select=len(S)
goukei=10**10
for i in range(1,100):
    kouho=0
    for j in range(select):
        kouho+=(S[j]-i)**2
    
    if kouho<goukei:
        goukei=kouho
    
print(goukei)
# Judge status: Accepted
from math import atan, degrees
a, b, x = map(int, input().split())

if a * a * b / 2 >= x:
    ans = 90 - degrees(atan((2 * x) / (a * b * b)))
else:
    ans = degrees(atan((2 * ((a**2 * b) - x))/(a ** 3)))
print(ans)
# Judge status: Accepted
import sys
A,B = map(int,input().split())

if not (1 <= A <= 16 and 1 <= B <= 16 and (A + B <= 16)) :
    sys.exit()

print('Yay!') if A <= 8 and B <= 8 else print(':(')
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))

c = 0
m = p[0]
for i in p:
    if m >= i:
        c += 1
        m = i

print(c)
# Judge status: Accepted
n=input()
l=len(n)-1
if int(n)==(int(n[0])+1)*10**l-1:
    print(int(n[0])+9*l)
else:
    print(int(n[0])+9*l-1)
# Judge status: Accepted
a, b, c, d = map(int, input().split())
if -(-a//d)+1 > -(-c//b):
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
a,b=map(int,input().split())

if (a-1)%13>(b-1)%13:
  print("Alice")
elif (a-1)%13<(b-1)%13:
  print("Bob")
else:
  print("Draw")
# Judge status: Accepted
n = int(input())
a = [int(i) for i in input().split()]

count = 0
for i in range(n):
    if(i % 2 == 0 and a[i] % 2 == 1):
        count +=1


print(count)
# Judge status: Accepted
n = int(input())
k =[0]*n
a = list(map(int, input().split()))

for i in range(n-1):
    k[a[i]-1] += 1

for i in range(len(k)):
    print(k[i])
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip()

mod = 1000000007
X,Y = map(int, input().split())


def combination(n, r, mod):
    r = min(r, n-r)

    numer = 1
    denom = 1

    for i in range(r):
        numer = numer * (n-i) % mod
        denom = denom * (r-i) % mod

    return numer * pow(denom, mod-2, mod) % mod


m_n = (X+Y) // 3
m = X - m_n
n = Y - m_n

if (X+Y) % 3 != 0 or m < 0 or n < 0:
    print(0)
    exit()

    
print(combination(m_n, m, mod))
# Judge status: Wrong Answer
s=input()
if str(s in "S")==str(s in "N") and str(s in "E")==str(s in "W"):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import math
N=int(input())
X=N/1.08
X=math.ceil(X)
if math.floor(X*1.08)==N:
  print(X)
else:
  print(":(")
# Judge status: Accepted
n=int(input())
import sys
sys.setrecursionlimit(10 ** 6)
h=list(map(int,input().split()))
cos={0:0,1:abs(h[1]-h[0])}
def cost(x):
  if x not in cos:
    d1=cost(x-1)+abs(h[x]-h[x-1])
    d2=cost(x-2)+abs(h[x]-h[x-2])
    cos[x]=min(d1,d2)
    return cos[x]
  else:
    return cos[x]
  
print(cost(n-1))
# Judge status: Wrong Answer
if len(list(set(list(input())))) == 4:
  print("Good")
else:
  print("Bad")
# Judge status: Accepted
X = int(input())
L = []
for i in range(33):
    for j in range(2, 10):
        x = i ** j
        if x <= X:
            L.append(x)

print(max(L))
# Judge status: Accepted
n = int(input())
h = list(map(int,input().split()))[::-1]
ans = 'Yes'
for i in range(n-1):
    if h[i+1] - h[i] >= 2:
        ans = 'No'
    elif h[i+1] - h[i] == 1:
        h[i+1] -= 1
print(ans)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-

n=int(input())
c = int((n * n/100.0) + 8)

print(c)
# Judge status: Accepted
N = int(input())
S = input()

d = {"R": 0, "G": 0, "B": 0}
for i in range(N):
    d[S[i]] += 1
    
ans = d["R"] * d["G"] * d["B"]

cnt = 0
for i in range(1, N - 1):
    for j in range(i + 1, N):
        k = 2 * j - i
        if k > N or S[i - 1] == S[j - 1]:
            continue
            
        if S[i - 1] != S[k - 1] and S[j - 1] != S[k - 1]:
            cnt += 1
            
print(ans - cnt)
# Judge status: Accepted
# B - Uneven Numbers

N = int(input())
cnt = 0
for i in range(1, N + 1):
    if len(str(i)) % 2 != 0:
        cnt += 1

print(cnt)
# Judge status: Accepted
def operate(x, y):
    if is_red[x]:
        is_red[y] = True
        if num_ball[x] == 1:
            is_red[x] = False
    num_ball[x] -= 1
    num_ball[y] += 1


if __name__ == "__main__":

    N, M = [int(x) for x in input().split(" ")]
    num_ball = [1 for _ in range(N)]
    is_red = [True] + [False for _ in range(N - 1)]

    for _ in range(M):
        x, y = [int(x) for x in input().split(" ")]
        x, y = x - 1, y - 1
        operate(x, y)
    print(sum(is_red))
# Judge status: Accepted
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B, K = map(int, readline().split())

    vec = []
    for n in range(1, max(A, B) + 1):
        if A % n == 0 and B % n == 0:
            vec.append(n)

    print(vec[-K])
    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
print(sum(h[:max(0,n-k)]))
# Judge status: Accepted
from fractions import gcd
#from math import gcd
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
a,b=map(int,input().split())
m=gcd(a,b)
P=prime_factorize(m)
print(1+len(list(set(P))))
# Judge status: Accepted
x = input()
y = input()

x = list(x)
y = list(y)
x_ = x
y_ = y
x_ = reversed(x)
y_ = reversed(y)
x_ = list(x_)
y_ = list(y_)


if y_ == x and x_ == y:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
N = int(input())
A = [[int(a) for a in input().split()] for _ in range(N)]
for i in range(N):
    z = A[i][0] + A[i][1]
    w = A[i][0] - A[i][1]
    if i==0:
        M_z = m_z = z
        M_w = m_w = w
    if z > M_z: M_z = z
    if z < m_z: m_z = z
    if w > M_w: M_w = w
    if w < m_w: m_w = w
print(max(M_z-m_z,M_w-m_w))
# Judge status: Accepted
a,b,c,x,y=map(int,input().split())

ans=10**9
for i in range(2*max(x,y)+1):
  s=max(x-i//2,0)
  t=max(y-i//2,0)
  t_ans=s*a+t*b+i*c
  ans=min(ans,t_ans)

print(ans)
# Judge status: Accepted
input()
from collections import *
c=Counter(map(int,input().split()))
print(sum(v-k*(k<=v) for k,v in c.items()))
# Judge status: Wrong Answer
from fractions import gcd

N = int(input())
As = list(map(int, input().split()))
re_As = As[::-1]
gcds = [0]*(N+1)
rgcds = [0]*(N+1)

for i in range(N):
    gcds[i] = gcd(As[i], As[i-1])
    rgcds[i] = gcd(re_As[i], re_As[i-1])

rgcds = rgcds[::-1]

ans = [0]*(N+1)

for i, (s, r) in enumerate(zip(gcds, rgcds)):
    ans[i] = gcd(s, r)
    
print(max(ans))
# Judge status: Wrong Answer
s=input()
n=len(s)
ans=0
for i in range(n-3):
  for j in range(i+3,n+1):
    if int(s[i:j])%2019==0:
      ans+=1
print(ans)
# Judge status: Accepted
N = int(input())

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

for i in range(N):
   for j in reversed(range(i+1,N)):
        #print(i,j)
        if a[j] > a[j-1]:
            temp = a[j]
            a[j] = a[j-1]
            a[j-1] = temp

Alice = 0
Bob = 0

k = 0
count =1
while k < N:
    if count % 2 == 0:
        Bob += a[k]
    else:
        Alice += a[k]
    k += 1
    count += 1

print(Alice-Bob)
# Judge status: Wrong Answer
from collections import defaultdict
dic = defaultdict(list)
N = int(input())
l = []
z = []
for _ in range(N):
    x, y = map(int, input().split())
    l.append([x, y])
    z.append(x+y)
z.sort()
ans = z[-1]-z[0]
    
for t in l:
    a = t[0]+t[1]
    dic[a].append(t)
for u in dic:
    dic[u].sort()
    b = dic[u][-1][0]-dic[u][0][0]
    ans = max(2*b,ans)
print(ans)
# Judge status: Accepted
N, M = map(int, input().split())
A = [""] * N
B = [""] * M

for i in range(N):
    A[i] = input()
for i in range(M):
    B[i] = input()

trm = [""] * M

for i in range(N-M+1):
    for j in range(N-M+1):
        trm = [A[k+i][j:j+M] for k in range(M)]
        if B == trm:
            print("Yes")
            break
    else:
        continue
    break
else:
    print("No")
# Judge status: Wrong Answer
n,p=map(int, input().split())
A=[int(i)%2 for i in input().split()]
t=sum(A)

if t==0:
    if p==1:
        sum=0
    else:
        print(2**n)
else:
    print(2**(n-1))
# Judge status: Accepted
w, h, n = map(int, input().split())

min_x, min_y, max_x, max_y = 0, 0, w, h
for _ in range(n):
    x, y, a = map(int, input().split())

    if a == 1:
        min_x = max(min_x, x)
    elif a == 2:
        max_x = min(max_x, x)
    elif a == 3:
        min_y = max(min_y, y)
    else:
        max_y = min(max_y, y)

if min_x < max_x and min_y < max_y:
    print((max_x - min_x) * (max_y - min_y))
else:
    print(0)
# Judge status: Accepted
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
print(a - int(a > b))