CodeEff/ECCO huggingface dataset:
# Original solution
def main():
    N = int(eval(input()))
    ans = 0
    for x in range(1, N + 1):
        # x(1+2+3+...+e)
        e = N // x
        ans += x * e * (1 + e) // 2
    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    N = int(eval(input()))
    ans = 0
    for x in range(1, int(N ** 0.5) + 1):
        # x(1+2+3+...+e)
        e = N // x
        ans += x * (e * e + e - x * x)
    print(ans)


if __name__ == '__main__':
    main()
# Original solution
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(eval(input()))
def MI(): return list(map(int, input().split()))
def MI1(): return list(map(int1, input().split()))
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(eval(input()))
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print((k.join(list(map(str, lst)))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right

def f(l, r, kousa=1):
    n = (r - l) // kousa
    return (r + l) * (n + 1) // 2

def solve():
    N = II()

    ans = 0
    for i in range(1, N+1):
        mx = i * (N // i)
        if mx == 0: mx = i
        # print(i, mx, f(i, mx, i))
        ans = ans + f(i, mx, i)

    print(ans)

if __name__ == '__main__':
    solve()


# Optimized solution
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(eval(input()))
def MI(): return list(map(int, input().split()))
def MI1(): return list(map(int1, input().split()))
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(eval(input()))
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print((k.join(list(map(str, lst)))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right

def f(l, r, kousa=1):
    n = (r - l) // kousa
    return (r + l) * (n + 1) // 2

def solve():
    N = II()
    # N = 10

    ans = 0
    for i in range(1, N+1):
        mx = i * (N // i)
        # print(i, mx)
        if i == mx:
            ans = ans + f(i, N, 1)
            break
            # mx = i
        # print(i, mx, f(i, mx, i))
        ans = ans + f(i, mx, i)
    print(ans)

if __name__ == '__main__':
    solve()
# Original solution
n=int(eval(input()))
#n=10000000
ksum=0
for k in range(1,n+1):
    m=n//k
    ksum+=k*m*(m+1)//2
    
print(ksum)

# Optimized solution
n=int(eval(input()))

ksum=0
nn=n//2
for k in range(1,nn+1):
    m=n//k
    ksum+=k*m*(m+1)//2

ksum=ksum+(n-nn)*(n++nn+1)//2

print(ksum)
# Original solution
n=int(eval(input()))
ans=0
for i in range(1,n+1):
  key=n//i
  ans+=int(key*(key+1)*i/2)
print(ans)

# Optimized solution
n=int(eval(input()))
ans=0
for i in range(1,n+1):
  key=n//i
  ans+=(key*(key+1)*i//2)
print(ans)
# Original solution
n=int(eval(input()))
ans=0
for i in range(1,n+1):
  key=n//i
  ans+=(key*(key+1)*i//2)
print(ans)

# Optimized solution
n=int(eval(input()))
ans=0
for i in range(1,n+1):
  key=n//i
  ans+=key*i*(1+key)/2
print((int(ans)))
# Original solution
n = int(eval(input()))
cnt = 0
for i in range(1, n+1):
    hoge = int(n//i)
    cnt += (hoge + 1) * i * hoge // 2
print(cnt)

# Optimized solution
n = int(eval(input()))
cnt = 0
for i in range(1, n+1):
    hoge = n//i
    cnt += (hoge + 1) * i * hoge / 2
print((int(cnt)))
# Original solution
N = int(eval(input()))

ans = 0
for i in range(1, N + 1):
    n = N // i
    ans += i * (n + 1) * n // 2

print(ans)

# Optimized solution
N = int(eval(input()))
print((sum(i * (N // i) * (N // i + 1) // 2 for i in range(1, N + 1))))
# Original solution
N = int(eval(input()))

total = 0
for i in range(1, N + 1):
    N_max = N // i * i
    num = N // i
    total += (N_max + i) * (num // 2)
    if num%2:
        total += (N_max + i) // 2
print(total)

# Optimized solution
N = int(eval(input()))

total = 0
for i in range(1, N + 1):
    a = N // i
    total += (a * i + i) * a
    # if num%2:
    #     total += (N_max + i) // 2
print((int(total / 2)))
# Original solution
import math

N = int(eval(input()))
ans = 0
print((int(sum([math.floor(N / (i+1)) * (math.floor(N / (i+1)) + 1) * (i+1) / 2  for i in range(N)]))))


# Optimized solution
N = int(eval(input()))
ans = 0
 
for i in range(1, N+1):
  Y = N // i
  ans += Y * (Y+1) * i / 2
  
print((int(ans)))
# Original solution
N = int(eval(input()))
ans = 0
 
for i in range(1, N+1):
  Y = N // i
  ans += Y * (Y+1) * i / 2
  
print((int(ans)))


# Optimized solution
N = int(eval(input()))
ans = sum([(N//i) * (N//i + 1) * i / 2  for i in range(1, N+1)])
print((int(ans)))
# Original solution
N = int(eval(input()))
ans = 0
for i in range(1,N+1):
    ans += N//i*(2*i + (N//i-1)*i)//2
    
print(ans)

# Optimized solution
def solve(N):
    ans = 0
    for i in range(1,N+1):
        ans += N//i*(2*i + (N//i-1)*i)//2
    
    return ans 

print((solve(int(eval(input())))))
# Original solution
n = int(eval(input()))
res = 0
for i in range(1, n+1):
    res += (int(n / i) * (i + int(n / i) * i)) // 2
print(res)

# Optimized solution
#別解思考
n = int(eval(input()))
res = 0
for i in range(1, n // 2 +1):
    res += (int(n / i) * (i + int(n / i) * i)) // 2
res += (n + n // 2 +1) * (n - n // 2 ) //2
print(res)
# Original solution
n=int(eval(input()));a=0;
for i in range(n): i+=1;y=n//i;a+=y*(y+1)//2*i
print(a)

# Optimized solution
n=int(eval(input()));print((sum([n//i*(n//i*i+i)//2 for i in range(1,n+1)])))
# Original solution
def resolve():
    N = int(eval(input()))

    def calc(x: int, n: int):
        y = int(n/x)
        return int(y * (y + 1) * x / 2)

    result = 0
    for i in range(1, N+1):
        result += calc(i, N)
    print(result)

if __name__ == "__main__":
    resolve()

# Optimized solution
def resolve():
    N = int(eval(input()))

    ans = 0
    for i in range(1, N+1):
        n = N // i
        ans += i * (n + 1) * n // 2
    print(ans)

if __name__ == "__main__":
    resolve()
# Original solution
N = int(eval(input()))
ans = 0
for i in range(1, N+1):
  n = N//i
  cnt = (n*(2*i + (n-1) *i))//2
  ans += cnt
print(ans)

# Optimized solution
N = int(eval(input()))
ans = 0
for i in range(1, N+1):
  n = N//i
  cnt = i*n*(n+1)//2
  ans += cnt
print(ans)
# Original solution
N = int(eval(input()))
ans = 0
for i in range(1, N + 1):
    n = N // i
    cnt = (n * (2 * i + (n - 1) * i)) // 2
    ans += cnt
print(ans)


# Optimized solution
N = int(eval(input())); print((sum((((N // i) * (2 * i + (N // i - 1) * i) // 2) for i in range(1, N + 1)))))
# Original solution
N = int(eval(input()))

a = 0
def g(x):
    y = N//x
    return y * (y+1)*x//2

print((sum(g(x) for x in range(1,N+1))))
    
        


# Optimized solution
# ABC172 C
N = int(eval(input()))
print((sum((N//x)*(N//x+1)*x//2 for x in range(1,N+1))))
# Original solution
n=int(eval(input()))

ans=0
for i in range(1,n+1):
    k=n//i
    ans+=k*(k+1)//2*i

print(ans)


# Optimized solution
n=int(eval(input()))

ans=0
lastk=n
for i in range(1,n+1):
    k=n//i
    ans+=i*(i-1)//2*(lastk+k+1)*(lastk-k)//2
    if i>k:
        break
    ans+=k*(k+1)//2*i
    if i==k:
        break
    lastk=k

print(ans)
# Original solution
def solve():
    n = int(eval(input()))

    ans = (n * (n+1))//2

    for i in range(2, n+1):
        d = (n // i) * i
        sigma = (d * (d+i))//(2*i)
        ans += sigma

    return ans


def main():
    print((solve()))


if __name__ == "__main__":
    main()


# Optimized solution
def solve():
    n = int(eval(input()))

    ans = n * (n+1) - 1

    r = int(n // 2)
    for i in range(2, r+1):
        d = (n // i) * i
        sigma = (d * (d+i))//(2*i) - i
        ans += sigma

    return ans


def main():
    print((solve()))


if __name__ == "__main__":
    main()
# Original solution
n=int(eval(input()))
ans=0
l=[x for x in range(1,n+1)]
for i in range(1,n+1):
  num=n//i
  k=num*((2*i)+((num-1)*i))
  ans+=k//2
print(ans)

# Optimized solution
n=int(eval(input()))
ans=0
for i in range(1,n+1):
  num=n//i
  k=num*i*(num+1)
  ans+=k//2
print(ans)
# Original solution
N = int(eval(input()))

ans=0
for i in range(1,N+1):
	n=N//i
	ans+=int(i*(n+1)*n/2)

print(ans)

# 2darray [[0] * 4 for i in range(3)]
# import itertools

# Optimized solution
N = int(eval(input()))

ans=0
for i in range(1,N+1):
	n=N//i
	ans+=i*(n+1)*n/2

print((int(ans)))

# 2darray [[0] * 4 for i in range(3)]
# import itertools
# Original solution
N = int(eval(input()))

ans = 0
for i in range(1, N+1):
    first = i
    n = N // i
    last = n * i
    ans += (first + last) * n // 2
print(ans)


# Optimized solution
import math
N = int(eval(input()))

ans = 0
for i in range(1, N+1):
    first = i
    n = N // i
    last = n * i
    ans += (first + last) * n // 2
print(ans)
# Original solution
import math
n=int(eval(input()))
g=0
for i in range(1,n+1):
    j= math.floor(n/i)
    g+= j*(j+1)*i/2
print((int(g)))

# Optimized solution

n=int(eval(input()))
g=0
for i in range(1,n+1):
    g+= 0.5*i*(n//i)*((n//i)+1)
print((int(g)))
# Original solution
N = int(eval(input()))
ans=0

#初項a、公差d=a、n項までの和
for a in range(1,N+1):
    n=N//a
    S=((2*a+(n-1)*a)*n)//2
    ans=ans+S
print(ans)


# Optimized solution
N = int(eval(input()))
ans=0

#初項a、公差d=a、n項までの和
for a in range(1,N+1):
    n=N//a
    ans=(n*(2*a+(n-1)*a))//2+ans
print(ans)
# Original solution
N = int(eval(input()))
ans = 0
for i in range(1,N+1):
    x = N // i
    ans += x * (x+1) * i // 2
print(ans)

# Optimized solution
N = int(eval(input()))
print((sum([(N//i)*(N//i+1)*i//2 for i in range(1,N+1)])))
# Original solution
n = int(eval(input()))

ans = 0
for a in range(1, n + 1):
    num = n // a
    ans += num * (num + 1) // 2 * a
print(ans)

# Optimized solution
n = int(eval(input()))

ans = 0
s = 1
for a in range(1, int(n ** .5) + 1):
    div = n // a
    ans += ((div + 1) * div // 2 - s) * a * 2 + a * a
    s += a + 1

print(ans)
# Original solution
# 幅優先探索（行きがけ）
import collections
import sys
import copy
import re
import math


def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())


def main():
    N = I()

    num = 0

    for i in range(1, N+1):
        y = math.floor(N/i)
        num += int((y*(y+1)*i)/2)

    print(num)


if __name__ == '__main__':
    main()


# Optimized solution
# 幅優先探索（行きがけ）
import collections
import sys
import copy


def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())


def main():
    N = I()

    num = 0

    for i in range(1, N+1):
        y = N//i
        num += int((y*(y+1)*i)/2)

    print(num)


if __name__ == '__main__':
    main()
# Original solution
# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

n, = list(map(int,readline().split()))

ans = 0
for i in range(1,n+1):
    ans += (i+i*(n//i))*(n//i)//2
print(ans)


# Optimized solution
def F(N): 
    r = int(N**0.5) # x >= 10^9 のときは注意
    ans = 0
    for d in range(1,N//r+1):
        ans += d*(1+(N//d))*(N//d)//2

    #print(ans)    
    for c in range(1,r):
        a = N//(c+1)
        b = N//c
        """
        (a,b] 上で d の和を求める
        """
        s = b*(b+1)//2-a*(a+1)//2
        ans += s*(c*c+c)//2
        #ans %= MOD
    return ans


# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

n, = list(map(int,readline().split()))
print((F(n)))
# Original solution
N = int(eval(input()))

ans = int(sum([j * (N//j)*(N//j+1)/2 for j in range(1,N+1)]))

print(ans)


# Optimized solution
N = int(eval(input()))

def gen():
  for j in range(1,N+1):
    yield j * (N//j)*(N//j+1)/2

ans = int(sum(gen()))

print(ans)
# Original solution
def f(n):
    ans=0
    for a in range(1,n+1):
        ans+=a*(n//a)*(n//a+1)//2
    print(ans)
if __name__ == "__main__":
    f(int(eval(input())))

# Optimized solution
n=int(eval(input()));print((sum(m*((n//m)**2+n//m-m**2)for m in range(1,int(n**.5)+1))))
# Original solution

N = int(eval(input()))

Answer = 0

for i in range(1,N+1):
    num = i*(N//i)*(N//i + 1) // 2
    Answer += num

print(Answer)


# Optimized solution
N = int(eval(input()))
print((sum(i*(N//i)*(N//i + 1) // 2 for i in range(1,N+1) )))
# Original solution
N = int(eval(input()))
print((sum(i*(N//i)*(N//i + 1) // 2 for i in range(1,N+1) )))

# Optimized solution
n=int(eval(input()));print((sum(m*((g:=n//m)**2+g-m**2)for m in range(1,int(n**.5)+1))))
# Original solution
n=int(eval(input()))
ans=0
for i in range(1,n+1):
    A=n//i
    ans+=((A**2+A)*i//2)
print(ans)

# Optimized solution
n=int(eval(input()))
ans=0
for i in range(1,n+1):
    A=n//i
    ans+=(A*(A+1)*i//2)
print(ans)
# Original solution
N = int(eval(input()))

def g(n):
  return ((n**2)+n)//2

goukei = 0
for i in range(1,N+1):
  goukei += (i*g(N//i))
print(goukei)

# Optimized solution
N = int(eval(input()))

def g(n):
  return ((n**2)+n)//2

goukei = 0
half = N//2
for i in range(1,half+1):
  goukei += i*g(N//i)

add = list(range(half+1,N+1))
goukei += sum(add)
print(goukei)
# Original solution
import math
N=int(eval(input()))
ans=0
for i in range(1,N+1):
  Y=math.floor(N/i)
  ans+=(Y*(Y+1)*i)//2
print(ans)


# Optimized solution
N = int(eval(input()))
ans = 0
for i in range(1, N + 1):
    largest = N // i * i
    ans += ((largest + i) * (N // i)) // 2
print(ans)
# Original solution
N = int(eval(input()))

s,k,n = 0,1,N
while k<=n:
	m = N//k
	s += (k-1)*k*(n-m)*(n+m+1)//2
	s += k*m*(m+1)
	k,n = k+1,m
if m<k-1:
	s -= (k-1)*m*(m+1) 
print((s//2))


# Optimized solution
N = int(eval(input()))

s=k=kn=0;n=N
while k<n:
	k += 1
	n = N//k
	kn = k*n*(n+1)
	s += 4*kn
s -= (k+1)*kn
if n<k:
	s -= 2*kn 
print((s//4))
# Original solution
import itertools
a, b = list(map(int, input().split()))

#約数
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
import math

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True
c = make_divisors(a)
d = make_divisors(b)

f = list(set(c) & set(d))
ans = []

for s in f:
    if is_prime(s):
        ans.append(s)
print((len(ans)+1))

# Optimized solution
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 = list(map(int, input().split()))
list_A = set(prime_factorize(a))
list_B = set(prime_factorize(b))
ans = list_A & list_B
print((len(ans) + 1))
# Original solution
#from collections import defaultdict 
import copy
import math
A,B = list(map(int, input().split()))

num = min(A,B)
tmps = {}
p = 2
for p in range(2, math.ceil(num**0.5)+1):

    if A % p == 0 and B % p == 0:
        tmps[p] = True

    if A % (num//p) == 0 and B % (num//p) == 0:
        tmps[num//p] = True

    p += 1

if num != 1 and  A % num == 0 and B % num == 0:
    tmps[num] = True


d = copy.deepcopy(tmps)
for k in list(tmps.keys()):

    if d.get(k, False):
        aaa = copy.deepcopy(d)
        for n in list(d.keys()):
            if k == n:
                continue
            if n > k and n % k == 0:
                aaa.pop(n)
        d = aaa

print((len(list(d.keys()))+1))



# Optimized solution
A,B = list(map(int, input().split()))




def getPrimeFactorsList(num):
  pn = 2 #素数は2から
  pflist = [] #素因数のリスト
  while pn * pn <= num: #√numまで調べる
    while num % pn == 0: #現在の素数で割り切れる範囲でループ
      num = num / pn
      pflist.append(pn)
    pn += 1 #割り切れなくなったら次の素数へ
  if num > 1:
    pflist.append(int(num))
    
  return pflist

pf_A = getPrimeFactorsList(A)
pf_B = getPrimeFactorsList(B)
ans = len(set(pf_A) & set(pf_B)) + 1
print(ans)
# Original solution
import sys
input=sys.stdin.readline

import fractions
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

import math
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

import collections
def main():
    A,B = list(map(int, input().split()))

    da = make_divisors(A)
    db = make_divisors(B)
    cds = set(da) & set (db)
    P = prime_factorize(max(cds))
    P.append(1)
    c = list(collections.Counter(P).keys())
    x = cds & set(c)
    print((len(x)))


if __name__ == '__main__':
    main()


# Optimized solution
import sys
input=sys.stdin.readline

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

def main():
    A,B = list(map(int, input().split()))
    ps = set(prime_factorize(A)) & set(prime_factorize(B))
    print((len(ps)+1))

if __name__ == '__main__':
    main()
# Original solution
# ABC142D - Disjoint Set of Common Divisors
def gcd(x: int, y: int) -> int:
    while y:
        x, y = y, x % y
    return x


def prime_factorization(x: int) -> dict:
    max_prime, ret = 0, {}

    # Divide x by 2 as much as possible
    cnt = 0
    while x % 2 == 0:
        x //= 2
        cnt += 1
    if cnt > 0:
        max_prime = 2
        ret[max_prime] = cnt

    # x must be odd -> skip even numbers
    cnt = 0
    for i in range(3, int(x ** 0.5) + 1, 2):
        cnt = 0
        while x % i == 0:
            x //= i
            max_prime = i
            cnt += 1
        if cnt > 0:
            ret[max_prime] = cnt

    if x > 2:  # To handle the case when x is prime greater than 2
        max_prime = x
        ret[max_prime] = 1
    return ret


def main():
    # compute the number of common prime factors
    A, B = list(map(int, input().split()))
    g = gcd(A, B)
    ans = len(list(prime_factorization(g).keys())) + 1
    print(ans)


if __name__ == "__main__":
    main()

# Optimized solution
# ABC142D - Disjoint Set of Common Divisors
def gcd(x: int, y: int) -> int:
    while y:
        x, y = y, x % y
    return x


def prime_factors(x: int) -> list:
    if x % 2:
        max_prime, factors = 0, []
    else:
        max_prime, factors = 2, [2]
        while x % 2 == 0:
            x //= 2
    for i in range(3, int(x ** 0.5) + 1, 2):
        if x % i == 0:
            max_prime = i
            factors.append(i)
            while x % i == 0:
                x //= i
    if x > 2:  # when x is prime greater than 2
        factors.append(x)
    return factors


def main():
    # compute the number of prime factors of gcd(A, B)
    A, B = list(map(int, input().split()))
    g = gcd(A, B)
    ans = len(prime_factors(g)) + 1
    print(ans)


if __name__ == "__main__":
    main()
# Original solution
import math


# 公約数列挙
# 重複する約数は1つにまとまるので注意
def make_common_divisors(x1, x2):
    cd = [1]
    for i in range(2, min(x1, x2) + 1):
        if x1 % i == 0 and x2 % i == 0:
            cd.append(i)
    return cd


A, B = list(map(int, input().split()))
CD = make_common_divisors(A, B)


# 引数nが素数かどうかを判定
def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


count = 1
for i in range(len(CD)):
    if is_prime(CD[i]):
        count += 1

print(count)


# Optimized solution

# nを素因数分解したリストを返す
def decomposition_prime(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n /= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(int(n))
    return table

A, B = list(map(int, input().split()))
Ap = set(decomposition_prime(A))
Bp = set(decomposition_prime(B))
print((len(Ap & Bp)+1))
# Original solution
import fractions
from itertools import combinations
import heapq
def cf(x1,x2):
    cf=[1]
    for i in range(2,min(x1,x2)+1):
        if x1 % i == 0 and x2 % i == 0:
            cf.append(i)
    return cf
def compromise(x1, x2):
    f = fractions.gcd(x1, x2)
    return f == 1
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
def isPrime(n):
  if n < 2:
    # 2未満は素数でない
    return False
  if n == 2:
    # 2は素数
    return True
  for p in range(2, n):
      if n % p == 0:
        # nまでの数で割り切れたら素数ではない
        return False
  # nまでの数で割り切れなかったら素数
  return True

a, b = list(map(int, input().split()))
cfs = cf(a, b)
total = len(cfs)
for c in cfs:
    if not isPrime(c):
        total -= 1
print((total+1))

# Optimized solution
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 = list(map(int, input().split()))
apri = set(prime_factorize(a))
bpri = set(prime_factorize(b))
print((len(apri & bpri)+1))
# Original solution

def sieve(n):
    nums = [i+1 for i in range(2, n, 2) if (i+1) % 3 != 0 and (i+1) % 5 !=0] # リスト内包表記で3,5の倍数をはじく
    ans = [2,3,5] # 3,5は素数なので加えてしまう
    while nums[0] <= n**0.5:
        for i in range(nums[0]**2, nums[-1]+1, nums[0]):
            if i in nums: nums.remove(i)
            ans.append(nums.pop(0))
            ans += nums
    return ans


A,B =list(map(int,input().split()))
if A<B:
    A,B =B,A
foo = 1
while foo != 0:
    A,B = B, A%B
    #print(A,B)
    foo = B

foo =A

plis = sieve(1000)
ans = 1
for p in plis:
    if foo%p==0:
        ans += 1
        foo = foo//p
    while foo%p ==0:
        foo = foo//p



plis = sieve(max(7,foo))

for p in plis:
    if  foo % p ==0:
        ans += 1
        foo = foo//p
        if foo < 1:
            break
print(ans)



# Optimized solution

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

#素数列挙
def searchPrimeNum(N):
    max = int(N**0.5)
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum



#素因数分解(素数列挙が必要)
def pfact(N):
    plis = searchPrimeNum(int(N**0.5+1))
    ans = 1
    for p in plis:
        if N%p == 0:
            ans += 1
            N = N//p
        while N%p == 0:
            N = N//p
        if N == 1:
            break
    if N != 1:
        ans += 1
    return ans

#互除法(最大公約数)
def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)

print((pfact(gcd(A,B))))