import fractions as f,subprocess as s;print((len(set(s.Popen(('factor',str(f.gcd(*list(map(int,input().split()))))),stdout=s.PIPE).stdout.read().split()))))
from subprocess import*;a,b=[set(Popen(('factor',x),stdout=PIPE).stdout.read().split()[1:])for x in input().split()];print((len(a&b)+1))
import fractions as f, subprocess as s

print(
    (
        len(
            set(
                s.Popen(
                    ("factor", str(f.gcd(*list(map(int, input().split()))))),
                    stdout=s.PIPE,
                )
                .stdout.read()
                .split()
            )
        )
    )
)

from subprocess import *

a, b = [
    set(Popen(("factor", x), stdout=PIPE).stdout.read().split()[1:])
    for x in input().split()
]
print((len(a & b) + 1))

-import fractions as f, subprocess as s +from subprocess import * -print( -    ( -        len( -            set( -                s.Popen( -                    ("factor", str(f.gcd(*list(map(int, input().split()))))), -                    stdout=s.PIPE, -                ) -                .stdout.read() -                .split() -            ) -        ) -    ) -) +a, b = [ +    set(Popen(("factor", x), stdout=PIPE).stdout.read().split()[1:]) +    for x in input().split() +] +print((len(a & b) + 1))