void max(long long *n,long long *m)
{
long long tmp;
if(m > n)
{
tmp = *n;
*n = *m;
*m = tmp;
}
}
long long Common(long long n, long long m)
{
long long k,t,mul;
mul = n * m;
while(k = n % m)
{
n = m;
m = k;
}
t = mul / m;
return t + m;
}
int main()
{
long long n,m,result;
scanf("%ld %ld", &n, &m);
max(&n, &m);
result = Common(n, m);
printf("%ld", result);
return 0;
}