#4問目
import math
import fractions
import collections
A, B = map(int, input().split())

count = 0
gcd = fractions.gcd(A,B)

def devisor(num):
    array = []
    for i in range(1, math.floor(math.sqrt(num)) + 1):
        if(num % i == 0):
            array.append(i)
            array.append(math.floor(num / i))
    return array

def prime(n):
    prime = []
    while n % 2 == 0:
        prime.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            prime.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        prime.append(n)
    return prime

print(len(collections.Counter(prime(gcd))) + 1) import math math import fractions fractions import collections collections A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B count = 0 count 0 gcd = fractions.gcd(A,B) gcd fractions.gcd(A,B) fractions.gcd fractions gcd A B def devisor(num):
    array = []
    for i in range(1, math.floor(math.sqrt(num)) + 1):
        if(num % i == 0):
            array.append(i)
            array.append(math.floor(num / i))
    return array devisor array = [] array [] for i in range(1, math.floor(math.sqrt(num)) + 1):
        if(num % i == 0):
            array.append(i)
            array.append(math.floor(num / i))
     i range(1, math.floor(math.sqrt(num)) + 1) range 1 math.floor(math.sqrt(num)) + 1 math.floor(math.sqrt(num)) math.floor math floor math.sqrt(num) math.sqrt math sqrt num 1 if(num % i == 0):
            array.append(i)
            array.append(math.floor(num / i))
     num % i == 0 num % i num i 0 array.append(i) array.append array append i array.append(math.floor(num / i)) array.append array append math.floor(num / i) math.floor math floor num / i num i return array array num num def prime(n):
    prime = []
    while n % 2 == 0:
        prime.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            prime.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        prime.append(n)
    return prime prime prime = [] prime [] while n % 2 == 0:
        prime.append(2)
        n //= 2
     n % 2 == 0 n % 2 n 2 0 prime.append(2) prime.append prime append 2 n //= 2 n 2 f = 3 f 3 while f * f <= n:
        if n % f == 0:
            prime.append(f)
            n //= f
        else:
            f += 2
     f * f <= n f * f f f n if n % f == 0:
            prime.append(f)
            n //= f
        else:
            f += 2
     n % f == 0 n % f n f 0 prime.append(f) prime.append prime append f n //= f n f f += 2 f 2 if n != 1:
        prime.append(n)
     n != 1 n 1 prime.append(n) prime.append prime append n return prime prime n n print(len(collections.Counter(prime(gcd))) + 1) print len(collections.Counter(prime(gcd))) + 1 len(collections.Counter(prime(gcd))) len collections.Counter(prime(gcd)) collections.Counter collections Counter prime(gcd) prime gcd 1 A, B = map(int, input().split()) map(int, input().split()) A count = 0 0 count gcd = fractions.gcd(A,B) fractions.gcd(A,B) gcd def prime(n):
    prime = []
    while n % 2 == 0:
        prime.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            prime.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        prime.append(n)
    return prime def prime(n):
    prime = []
    while n % 2 == 0:
        prime.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            prime.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        prime.append(n)
    return prime prime def devisor(num):
    array = []
    for i in range(1, math.floor(math.sqrt(num)) + 1):
        if(num % i == 0):
            array.append(i)
            array.append(math.floor(num / i))
    return array def devisor(num):
    array = []
    for i in range(1, math.floor(math.sqrt(num)) + 1):
        if(num % i == 0):
            array.append(i)
            array.append(math.floor(num / i))
    return array devisor B = map(int, input().split()) map(int, input().split()) B
#4問目
import math
import fractions
import collections
A, B = map(int, input().split())

count = 0
gcd = fractions.gcd(A,B)

def devisor(num):
    array = []
    for i in range(1, math.floor(math.sqrt(num)) + 1):
        if(num % i == 0):
            array.append(i)
            array.append(math.floor(num / i))
    return array

def prime(n):
    prime = []
    while n % 2 == 0:
        prime.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            prime.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        prime.append(n)
    return prime

print(len(collections.Counter(prime(gcd))) + 1)