Harryxun/stf_run huggingface dataset:
from collections import defaultdict as dd
from itertools import combinations
n = int(input())
Points = []
for i in range(n):
    Points.append(list(map(int, input().split())))

Vector = dd(lambda: 0)
for point1, point2 in combinations(Points, 2):
    if point1[0] >= point2[0]:
        x_v = point1[0] - point2[0]
        y_v = point1[1] - point2[1]
    else:
        x_v = point2[0] - point1[0]
        y_v = point2[1] - point1[1]
    Vector[(x_v, y_v)] += 1

print(max(n - max(Vector.values()), 0))



### FIXED CODE ###

from collections import defaultdict as dd
from itertools import combinations
from sys import exit
n = int(input())
if n == 1:
    print(1)
    exit()

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

Vector = dd(lambda: 0)
for point1, point2 in combinations(Points, 2):
    if point1[0] > point2[0]:
        x_v = point1[0] - point2[0]
        y_v = point1[1] - point2[1]
    elif point1[0] == point2[0] and point1[1] >= point2[1]:
        x_v = point1[0] - point2[0]
        y_v = point1[1] - point2[1]
    else:
        x_v = point2[0] - point1[0]
        y_v = point2[1] - point1[1]
    Vector[(x_v, y_v)] += 1
#print(Vector)

print(max(n - max(Vector.values()), 1))
S = input()
K = int(input())
count = 0
for i in range(len(S)):
  if S[i] == '1':
    count = count + 1
  else:
    break

if count<K and count>0:
  print(S[1])
elif count>=K:
  print(S[count])
else:
  print(S[0])

### FIXED CODE ###

S = input()
K = int(input())
result = ''
for i in S[:K]:
  if i != '1':
    result = i
    break
else:
    result = '1'

print(result)
r = int(input())
ret = r * r * 3.141592
print('{0:.5f} {1:.5f}'.format(ret, ret))

### FIXED CODE ###

import math
r = float(input())
print('{0:.6f} {1:.6f}'.format(r * r * math.pi, (r + r) * math.pi))
n = int(input())
p = [list(map(int, input().split())) for i in range(n)]

m = [[0] * n for i in range(n)]

for l in range(2, n + 1):
    for i in range(n - k + 1):
        j = i + l - 1
        m[i][j] = float('inf')
        for k in range(i, j):
            m[i][j] = min(m[i][j], m[i][k] + m[k + 1][j] + p[i][0] * p[k][1] * p[j][1])

print(m[0][n - 1])

### FIXED CODE ###

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

m = [[0] * n for i in range(n)]

for l in range(2, n + 1):
    for i in range(n - l + 1):
        j = i + l - 1
        m[i][j] = float('inf')
        for k in range(i, j):
            m[i][j] = min(m[i][j], m[i][k] + m[k + 1][j] + p[i][0] * p[k][1] * p[j][1])

print(m[0][n - 1])
A = int(input())
B = int(input())
C = int(input())
D = int(input())

if A*B > C*D:
  print(A*B)
elif A*B < C*D:
  print(C*D)
else:
  print(A*B)

### FIXED CODE ###

a,b,c,d=map(int,input().split())
print(max(a*b,c*d))
from math import atan, degrees
a, b, x = map(int, input().split())

#ans = max(90 - degrees(atan(0.5 * a ** 3/(a ** 2 * b - x))), 90 - degrees(atan(2 * x / (a * b ** 2))))
if 0.5 * a ** 2 * b < x:
    ans = 90 - degrees(atan(0.5 * a ** 3/(a ** 2 * b - x)))
else:
    ans = 90 - degrees(atan(2 * x / (a * b ** 2)))
print(ans)

### FIXED CODE ###

from math import atan, degrees
a, b, x = map(int, input().split())

#ans = max(90 - degrees(atan(0.5 * a ** 3/(a ** 2 * b - x))), 90 - degrees(atan(2 * x / (a * b ** 2))))
if a ** 2 * b == x:
    ans = 0
else:
    if 0.5 * a ** 2 * b < x:
        ans = 90 - degrees(atan(0.5 * a ** 3/(a ** 2 * b - x)))
    else:
        ans = 90 - degrees(atan(2 * x / (a * b ** 2)))

print(ans)
a,b=input().split()
aa=int(a)
bb=int(b)
print aa*bb,2*(aa+bb)

### FIXED CODE ###

a ,b = input().split(" ")

a = int(a)
b = int(b)


area = a*b
perimitar = 2 * (a + b)

print("{} {}".format(area, perimitar))
import numpy as np

N = int(input())
a = input().split()

a = np.array(a)

unique_elements, counts_elements = np.unique(a, return_counts=True)
elements = unique_elements[counts_elements == max(counts_elements)]
for i in elements:
    print(i)


### FIXED CODE ###

import numpy as np

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

a = np.sort(np.array(a))

unique_elements, index_elements = np.unique(a, return_index = True)
l = []
for i in range(index_elements.size -1):
  m = index_elements[i + 1] - index_elements[i]
  l.append(m)
l.append(a.size - index_elements[-1])    
elements = unique_elements[l == max(l)]


for i in elements:
	print(i)
x = str(input())
if x[n] == 0:
  print(n)

### FIXED CODE ###

print(15 - sum(list(map(int , input().split()))))
# http://www.deqnotes.net/acmicpc/p0006/
import re
import numpy

def back_oturigation(fee, coin_values, coin_nums):
    """
    1. ????????????????????????????????£??????????????????
    2. 1????????????????????????????????????????????????????????????
       ???????????§?????????????????????-> ?°????????????????????¶???????????????????
    3. 2????????????????????°?????????????????????????????????????????????
    """
    # 1
    coin_values=numpy.array(coin_values)
    coin_nums=numpy.array(coin_nums)
    all = numpy.dot(coin_values, coin_nums)
    oturi = all - fee

    use_coins = [0] * len(coin_values)
    no_use_coins = [0] * len(coin_values)

    # 2.
    for i in reversed(range(0,len(coin_values))):
        no_use_coins[i] = int(oturi / coin_values[i])
        oturi = oturi - (coin_values[i] * no_use_coins[i])

    # 3.
    for i in range(0, len(use_coins), 1):
        use_coins[i] = coin_nums[i] - no_use_coins[i]
        if use_coins[i] > 0:
            print(str(coin_values[i]) + ' ' + str(use_coins[i]))

if __name__ == "__main__":
    first = True
    while (True):
        total_fee = int(input(''))
        if total_fee == 0:
            break
        if first:
            first = False
        else:
            print('')
        coins = input('')
        coins = coins.split(' ')  # 10, 50, 100, 500????????§????????????
        coins = [int(coin) for coin in coins]
        coin_values = [10, 50, 100, 500]
        back_oturigation(total_fee, coin_values, coins)

### FIXED CODE ###

import math
def back_oturigation(fee, coin_values, coin_nums):
    """
    1. ?????????????????????????????????£??????????????????
    2. 1????????????????????????????????????????????????????????????
       ????????????§?????????????????????-> ??°?????????????????????¶???????????????????
    3. 2?????????????????????°?????????????????????????????????????????????
    """
    # 1.
    oturi = coin_values[0] * coin_nums[0] \
            + coin_values[1] * coin_nums[1] \
            + coin_values[2] * coin_nums[2] \
            + coin_values[3] * coin_nums[3] \
            - fee

    use_coins = [0] * len(coin_values)
    no_use_coins = [0] * len(coin_values)
 
    # 2.
    for i in range(len(coin_values) - 1, -1, -1):
        no_use_coins[i] = int(oturi / coin_values[i])
        oturi = oturi - (coin_values[i] * no_use_coins[i])
 
    # 3.
    for i in range(0, len(use_coins), 1):
        use_coins[i] = coin_nums[i] - no_use_coins[i]
        if use_coins[i] > 0:
            print(str(coin_values[i]) + ' ' + str(use_coins[i]))
 
if __name__ == "__main__":
    first = True
    while (True):
        total_fee = int(input(''))
        if total_fee == 0:
            break
        if first:
            first = False
        else:
            print('')
        coins = input('')
        coins = coins.split(' ')  # 10, 50, 100, 500?????????§????????????
        coins = [int(coin) for coin in coins]
        coin_values = [10, 50, 100, 500]
        back_oturigation(total_fee, coin_values, coins)
n,m = map(int, input().split())

ac = [0]*(n+1)
wa = [0]*(n+1)


for i in range(m):
	p, s = input().split()
    p = int(p)
    
    if s== "AC":
		ac[p] = 1
    else:
        if a[p]==0:
        	wa[p]+=1

for i in range(m):
	if ac[i]=0:
		wa[p]=0
        
print(sum(ac),sum(wa))


### FIXED CODE ###

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

ac = [0]*(n+1)
wa = [0]*(n+1)


for i in range(m):
	p, s = input().split()
	p = int(p)
    
	if s== "AC":
		ac[p] = 1
	else:
		if ac[p]==0:
			wa[p]+=1

for i in range(n+1):
	if ac[i]==0:
		wa[i]=0
        
print(sum(ac),sum(wa))
l,r=map(int,input().split())
if r-l>2019:
    print(0)
    exit()

ans=int(10000000)
for i in range(l,r):
    for j in range(j+1,r+1):
        if ans>i*j:
            ans=i*j

print(ans)

### FIXED CODE ###

l,r=map(int,input().split())
ans=int(10000000)
if r-l>2019:
    print(0)
    exit()

for i in range(l,r):
    for j in range(i+1,r+1):
        now=int((i*j)%2019)
        if ans>now:
            ans=now

print(ans)
n = int(input())

print(n ** 3

### FIXED CODE ###

n = int(input())

print(n ** 3)
import sys

sys.setrecursionlimit(10 ** 7)
# ----------

INF = float("inf")
MOD = 10 ** 9 + 7
# ----------

s = list(input().strip())
K = int(input())
N = len(s)

if N == 1:
    print(s[0])
    exit()
sub = set()
for i in range(N):
    for j in range(N):
        sub.add(s[i:j+1])

print(sorted(sub)[K])


### FIXED CODE ###


S = input().strip()
K = int(input())
L = len(S)
substr = set()

for i in range(L):
    for j in range(5):
        s = S[i:min(i+j+1, L)]
        if s:
            substr.add(s)

print(sorted(substr)[K-1])
N = int(input())
h = [0]
for i in range(N):
    h = list.append(int(input()))
max = 0
for i in range(n):
    if max <= h[i]:
        max = h[i]
        count += 1
print(count)

### FIXED CODE ###

N = int(input())
h = list(map(int, input().split()))
count = 0
max = 0
for i in range(N):
    if max <= h[i]:
        max = h[i]
        count += 1
print(count)
S = input()
K = int(input())


buf=''
cnt = 1
total = 0
cnts = []


for s in S:
    #print(buf,s,cnt)
    if s == buf:
        cnt += 1       
    else:
        cnts.append(cnt)
        total += int(cnt/2)
        cnt = 1        
    buf = s
cnts.append(cnt)    
total += int(cnt/2)

if len(S)==1:
    print(int(K/2))
    
elif len(set(list(S)))==1:
    print(int(len(S*K)/2))

elif S[0]==S[-1] and cnts[1] % 2 != 0:
    if (cnts[1]+cnts[-1]) % 2 == 0:
        print(total*K+K-1)
    else:
        print(total*K)
else:
    print(total*K)

### FIXED CODE ###

from itertools import groupby
S = input()
K = int(input())
a = [len(tuple(s)) for _, s in groupby(S)]
ans = 0
 
if S[0] == S[-1] and K > 1:
    if len(a) == 1:
        ans = a[0]*K // 2
    else:
        ans = a[0] // 2 + a[-1] // 2 + (a[0]+a[-1]) // 2 * (K-1)
        ans += sum(n // 2 for n in a[1:-1]) * K
else:
    ans = sum(n // 2 for n in a) * K
print(ans)
import numpy as np

H, W, M = map(int, input().split())
h = [0 for i in range(H)]
w = [0 for i in range(W)]
DP = np.zeros((H+10, W+10))

for i in range(M):
    hh, ww = map(int, input().split())
    h[hh - 1] += 1
    w[ww - 1] += 1
    DP[hh - 1][ww - 1] = 1

hhh = max(h)
www = max(w)
hhhh = [i for i, x in enumerate(h) if x == hhh]
wwww = [i for i, x in enumerate(w) if x == www]
check = 0


print(hhh + www - (1 - check))


### FIXED CODE ###

H, W, M = map(int, input().split())
h = [0 for i in range(H)]
w = [0 for i in range(W)]
DP = set()
for i in range(M):
    hh, ww = map(int, input().split())
    h[hh - 1] += 1
    w[ww - 1] += 1
    DP.add((hh - 1, ww - 1))

hhh = max(h)
www = max(w)
hhhh = [i for i, x in enumerate(h) if x == hhh]
wwww = [i for i, x in enumerate(w) if x == www]
check = 0

for i in hhhh:
    for j in wwww:
        if (i, j) not in DP:
            print(hhh + www)
            exit()
print(hhh + www - 1)
def dfs(i, c):
    C[i] = True
    P[i] = c
    for t in G[i]:
        if (C[t[0]] == True):
            continue
        dfs(t[0], c+t[1])
    return


N, M = list(map(int, input().split()))
G = [[] for _ in range(N+1)]
P = [None for _ in range(N+1)]
C = [False for _ in range(N+1)]

for i in range(M):
    l, r, d = list(map(int, input().split()))
    G[l].append((r,d))
    G[r].append((l,-d))

for i in range(1, N+1):
    if (C[i] == False):
        dfs(i,0)

f = False
for i in range(1, N+1):
    for t in G[i]:
        if (P[t[0]] - P[i] != t[1]):
            f = True
if (f):
    print('No')
else:
    print('Yes')

### FIXED CODE ###

import sys
sys.setrecursionlimit(200002)


def dfs(i, c):
    C[i] = True
    P[i] = c
    for t in G[i]:
        if (C[t[0]] == True):
            continue
        dfs(t[0], c+t[1])
    return


N, M = list(map(int, input().split()))
G = [[] for _ in range(N+1)]
P = [None for _ in range(N+1)]
C = [False for _ in range(N+1)]

for i in range(M):
    l, r, d = list(map(int, input().split()))
    G[l].append((r,d))
    G[r].append((l,-d))

for i in range(1, N+1):
    if (C[i] == False):
        dfs(i,0)

f = False
for i in range(1, N+1):
    for t in G[i]:
        if ((P[t[0]] - P[i]) != t[1]):
            f = True
if (f):
    print('No')
else:
    print('Yes')
n, m, k = map(int, input().split())
z = 998244353
if n <= k+1:
    a = 1
    for i in range(n):
        a = a*m%z
    print(a)
else:
    c = m
    for i in range(n-1):
        c = c*(m-1)%z
    a = [c]
    b = []
    d = [1, 1]
    e = [1, 1]
    f = [0, 1]
    for i in range(2, n):
        d.append(d[-1]*i%z)
        f.append((-e[z%i]*(z//i))%z)
        e.append(e[-1]*f[-1]%z)
    for i in range(k+1):
        b.append(d[n-1]*e[i]*e[n-i-1]%z)
    x = 0
    for i in range(1, k+1):
        a.append(int(a[-1]*b[i]/b[i-1]/(m-1))%z)
    for i in range(k+1):
        x = (x+a[i])%z
    print(x)

### FIXED CODE ###

n, m, k = map(int, input().split())
z = 998244353
if n <= k+1:
    a = 1
    for i in range(n):
        a = a*m%z
    print(a)
else:
    a = []
    b = []
    d = [1, 1]
    e = [1, 1]
    f = [0, 1]
    for i in range(2, n):
        d.append(d[-1]*i%z)
        f.append((-f[z%i]*(z//i))%z)
        e.append(e[-1]*f[-1]%z)
    for i in range(k+1):
        b.append(d[n-1]*e[i]*e[n-i-1]%z)
    x = 0
    g = [1]
    for i in range(n-1):
        g.append(g[i]*(m-1)%z)
    for i in range(k+1):
        a.append(b[i]*m*g[n-i-1]%z)
    for i in range(k+1):
        x = (x+a[i])%z
    print(x)
N, M = map(int, input().split())
cand = ['*'] * M
mn = ''
for m in range(M):
    s, c = map(int, input().split())
    if s==1 and c==0:
        mn = '-1'

    if cand[s-1] == '*' or cand[s-1] == str(c):
        cand[s-1] = str(c)
    else:
        mn = '-1'
if mn == '-1':
    print (mn)
    exit()

for i in range(N):
    if cand[i]=='*':
        if i==0:
            mn+='1'
        else:
            mn+='0'
    else:
        mn+=cand[i]
print (mn)

### FIXED CODE ###

N, M = map(int, input().split())
cand = ['*'] * N
mn = ''
for m in range(M):
    s, c = map(int, input().split())
    if s==1 and c==0 and N > 1:
        mn = '-1'

    if cand[s-1] == '*' or cand[s-1] == str(c):
        cand[s-1] = str(c)
    else:
        mn = '-1'
if mn == '-1':
    print (mn)
    exit()

for i in range(N):
    if cand[i]=='*':
        if i==0 and N > 1:
            mn+='1'
        else:
            mn+='0'
    else:
        mn+=cand[i]
print (mn)
n, m = (int(i) for i in input().split())
island = [[] for i in range(n)]

for i in range(m):
    a, b = (int(i)-1 for i in input().split())
    if a == 0:
        island[a].append(b)
    elif a == n-1:
        island[n-1].append(b)
    elif b == 0:
        island[b].append(a)
    elif b == n-1:
        island[n-1].append(a)

ans = "IMPOSSIBLE"
for i in island[0]:
    if i in island[n-1]:
        ans = "POSSIBLE"
        break

print(ans)

### FIXED CODE ###

n = str(input())
print("ABC"+n)
def euclidean(a,b):
  _ = a % b
  while 1:
    if b % _ == 0:
      break
    else:
      _ = b % _
    return _

A, B, K = map(int, input().split())

a = max(A, B)
b = min(A, B)
e = euclidean(a, b)

by = []
r = int(e ** (1 / 2))

for i in range(1, r + 1):
  if e % i == 0:
    by.append(i)
    j = e // i
    if j != i:
      by.append(j)
by.sort()
print(by[K - 1])

### FIXED CODE ###

def euclidean(a,b):
  _ = a % b
  if _ == 0:
    return b
  else:
    while 1:
      if b % _ == 0 :
        break
      else:
        _ = b % _
    return _
  
A, B, K = map(int, input().split())
 
a = max(A, B)
b = min(A, B)
e = euclidean(a, b)
by = []
r = int(e ** (1 / 2))
 
for i in range(1, r + 1):
  if e % i == 0:
    by.append(i)
    j = e // i
    if j != i:
      by.append(j)
by.sort(reverse = True)
print(by[K - 1])
N = int(input())
A = list(map(int,input().split()))
ans = [0] * N
for i, a in enumerate(A):
  ans[a-1] = i+1
print(*ans)

### FIXED CODE ###

import decimal
N = int(input())
if N % 2 == 0:
  print('0.5')
else:
  A = decimal.Decimal((N-(N//2))/N)
  print(A)
S =str(input())
if len(S) % 2 == 1:
    a = 1
    b = int((len(S) - 1) / 2)
    while True:
        if S[b] == S[b + a] and S[b] == S[b - a]:
            a = a + 1
        else:
            break
    c = a + b
    print(c)
else:
    d = 0
    e = int(len(S) / 2 - 1)
    f = S[e]
    while True:
        if S[e + 1] == f:
            d = d + 1
            if S[e - d] == f and S[e + d + 1] == f:
                d = d + 1
            else:
                break
        else:
            break
    g = d + e + 1
    print(g)

### FIXED CODE ###

S =str(input())
if len(S) % 2 == 1:
    a = 1
    b = int((len(S) - 1) / 2)
    while True:
        if b - a < 0:
            break
        if S[b] == S[b + a] and S[b] == S[b - a]:
            a = a + 1
        else:
            break
    c = a + b
    print(c)
else:
    d = 0
    e = int(len(S) / 2 - 1)
    f = S[e]
    if S[e + 1] == f:
        d = d + 1
    while True:
        if e - d < 0:
            break
        if S[e - d] == f and S[e + d + 1] == f:
            d = d + 1
        else:
            break
    g = d + e + 1
    print(g)
import math

lis = []
for _ in range(5):
    lis.append(int(input()))
    
def roundup(x):
    return int(math.ceil(x/10)) * 10
    

    
minind = 9
tmp2 = 0
for i in range(5):
    tmp = str(lis[i])
    if tmp[-1] != "0":
        minind = min(minind, int(tmp[-1]))
        if minind == int(tmp[-1]):
            tmp2 = lis[i]
lis.remove(tmp2)

for j in range(4):
    lis[j] = roundup(lis[j])
        
print(sum(lis)+tmp2)

### FIXED CODE ###

import math

lis = []
for _ in range(5):
    lis.append(int(input()))
    
def roundup(x):
    return int(math.ceil(x/10)) * 10
    

    
minind = 9
tmp2 = 0
for i in range(5):
    tmp = str(lis[i])
    if tmp[-1] != "0":
        minind = min(minind, int(tmp[-1]))
        if minind == int(tmp[-1]):
            tmp2 = lis[i]
   
if tmp2 == 0:
    print(sum(lis))
    exit()

lis.remove(tmp2)

for j in range(4):
    lis[j] = roundup(lis[j])
        
print(sum(lis)+tmp2)
N = int(input())

t = N //2 
intger = []

for n in range(t):
  intg = N / 2
  intger.append(intg)
  N = intg
  
intgersorted = sorted(intger)

print(intger[0])

### FIXED CODE ###

N = int(input())

if( N % 2 == 1):
  print( N * 2)
  
else:
  print(N)
# 初期入力
N = int(input())
word = [ input() for i in range(N) ]

# 単語をキーに数を数えて辞書
from collections import Counter
kazu_word = Counter(word)

#一番多い単語を抜き出す
kazu_word_a = max(kazu_word.values()) #　内包表記の中で毎回MAXを計算するより出したほうが１回で済む
kazu_word_max =[i for i,v in kazu_word.items() if v == kazu_word_a ]
kazu_word_max_sorted = sorted(kazu_word_max)
"""
print(kazu_word)
print(kazu_word_max)
"""
#print(*kazu_word_max_sorted,sep="\n")
print("\n".join(kazu_word_max_sorted)) #sortedをやめて sortにした

### FIXED CODE ###

# 初期入力
a,b,c = (int(x) for x in input().split(" "))

#
if a == b == c:
    print("No")
elif a == b or b ==c or a == c:
    print("Yes")
else:
    print("No")
from sys import stdin
n,k = map(int,stdin.readline().split())
a = []
for i in xrange(n):
 a.append(map(int,stdin.readline().split()))
def solve(i,j):
 cnt = 0
 minx = min(a[i][0],a[j][0])
 maxx =  max(a[i][0],a[j][0])
 miny = min(a[i][1],a[j][1])
 maxy = max(a[i][1],a[j][1])
 for m in xrange(n):
  if a[i][0]>=minx and a[i][0]<=maxx and a[i][1]>=miny and a[i][1]<=maxy:
   cnt+=1
 if cnt>=k:
  return (maxx-minx+1)*(maxy-miny+1)
 return 10**100
ans = 10**50
for i in xrange(n):
 for j in xrange(i+1,n):
  ans = min(ans,solve(i,j))
print ans

### FIXED CODE ###

from sys import stdin
a,b,c = map(int,stdin.readline().split())
print a^b^c
l = list(map(int, input().split()))
li =  list(map(int, input().split()))

g = []
for i in range(l[1]):
    a, b = map(int, input().split())
    if li[a-1] == li[b-1]:
        g += [a, b]
    if li[a-1] >= li[b-1]:
        g += [b]
    else:
        g += [a]
    print(g)

g = set(g)
print(l[0] - len(g))

### FIXED CODE ###

l = list(map(int, input().split()))
li =  list(map(int, input().split()))

g = []
for i in range(l[1]):
    a, b = map(int, input().split())
    if li[a-1] == li[b-1]:
        g += [a, b]
    if li[a-1] > li[b-1]:
        g += [b]
    else:
        g += [a]

g = set(g)
r = l[0] - len(g)
print(r)
N = int(input())
H = []
H = input().split(" ")
for i in range(N):
    H[i] = int(H[i])

ochinchin = True
for i in range(1, N):
    if H[i]<H[i-1]:
        H[i-1] -= 1
        if H[i]<H[i-1]:
            ochinchin = False
            break
        elif i >= 2:
            if H[i-1]<H[i-2]:
                ochinchin = False
                break

if ochinchin:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

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

X = b + c - a
if X >= 0:
    print(X)
else:
    print(0)
import math

A, B = map(int, input().split())


def dv(x1, x2):
    ret = []
    v = int(math.sqrt(min(x1, x2))) + 1

    check = [0] * (v + 1)

    for n in range(2, v + 1):
        if check[n] == 1:
            continue

        if x1 % n == 0 and x2 % n == 0:
            ret.append(n)

            cnt = 1
            while n * cnt <= v:
                check[n * cnt] = 1
                cnt += 1

    return ret

can = 0
if A >= B:
    if A % B == 0:
        can = B
else:
    if B % A == 0:
        can = A

cf = [1] + dv(A, B)

flag = False

for c in cf:
    if c % can == 0:
        flag = True
        break
        
if not flag:
    cf = cf + [can]

print(len(cf))

### FIXED CODE ###

A, B = map(int, input().split())


def prime_factorization(n):
    from collections import Counter
    counter = Counter()

    if n < 2:
        return counter

    for i in range(2, int(n ** 0.5) + 1):
        if i * i > n:
            break

        while n % i == 0:
            counter[i] += 1
            n //= i

    if n > 1:
        counter[n] += 1

    return counter


x = prime_factorization(A)
y = prime_factorization(B)

z = set(x.keys()) & set(y.keys())
print(len(z) + 1)
def main():
    num = int(input())
    data_a = list(map(int, input().split()))
    data_a.sort()
    data_b = list(map(int, input().split()))
    data_b.sort()
    data_c = list(map(int, input().split()))
    data_c.sort()

    shita_b = [0 for i in range(num)]

    ind = 0
    for i in range(num):
        now_b = data_b[i]
        while data_c[ind] <= now_b:
            ind += 1
            if ind >= num:
                ind = num
                break
        if ind == num:
            break
        shita_b[i] = num - ind


    ans = 0
    tasu_now = sum(shita_b)
    ind = 0
    for i in range(num):
        now_a = data_a[i]
        while now_a >= data_b[ind]:
            tasu_now -= shita_b[ind]
            ind += 1
            if ind >= num:
                ind = num
                break
        if ind == num:
            break
        ans += tasu_now

    print(ans)



if __name__ == '__main__':
    main()


### FIXED CODE ###



def main():
    a = [list(input()) for i in range(2)]
    b = [a[1][::-1], a[0][::-1]]

    # print(a, b)

    if a == b:
        print('YES')
    else:
        print('NO')



if __name__ == '__main__':
    main()
import itertools
num = int(input())
array1 = tuple(map(int, input().split()))
array2 = tuple(map(int, input().split()))
all_list = list(itertools.permutations(range(1, num + 1)))
 
array1_index = all_list.index(array1) + 1
array2_index = all_list.index(array2) + 1
 
if array1 > array2:
  print(array1-array2)
else:
  print(array2-array1)


### FIXED CODE ###

import itertools
num = int(input())
array1 = tuple(map(int, input().split()))
array2 = tuple(map(int, input().split()))
all_list = list(itertools.permutations(range(1, num + 1)))
 
array1_index = all_list.index(array1) + 1
array2_index = all_list.index(array2) + 1
 
if array1_index > array2_index:
  print(array1_index-array2_index)
else:
  print(array2_index-array1_index)