#include <stdio.h>

int main()
{
    long m,n;
    while(scanf("%ld %ld",&m,&n)==2){
        int i = m,j = n;
        int r;
        while(r = i%j){
            i = j;
            j = r;
        }
        printf("%ld",m*n/j+j);
    }
    return 0;
}