#include <stdio.h>

int main() {
    long  a, b;
    scanf("%ld %ld", &a, &b) ;
    long int c,m=a*b;
    if(b>a)
    {
        long int t=b;
        b=a;
        a=t;
    }
    c=a%b;
    while(c!=0)
    {
        a=b;
        b=c;
        c=a%b;
    }
    printf("%ld",b+m/b);
    return 0;
}