#include <stdio.h>

int main()
{
   long long a,b,temp,num1,num2;
   scanf("%lld %lld",&a,&b);
   num1 = a;
   num2 = b;
   if(a<b)
   {
       temp=a;
       a=b;
       b=temp;
   }
       temp=0;
   while(b!=0)
   {
       temp=a%b;
       a=b;
       b=temp;//余数作被除数,被除数作除数,继续相除直到余数为零,此时除数为最小公约数
   }
     printf("%lld ",num1*num2/a+a);
    return 0;
}