a=input().split()
m, n=a
m,n=int(m),int(n)
i=1
s=0;s1=m*n;sp=0;
if m<n:
    t=m;m=n;n=t
while i<=m:
    j=1;
    while (j<=n)and (j<=i):
        s2=i*j
        if sp<s2:
            if (s1%s2==0):
               s=s+s1;sp=s2;
            else:
                s=s+s1//(i*j)*(i*j);sp=s2;
        j+=1
       
    i+=1
    
print(s)
 

