#include <stdio.h> int main() { long long a,b,c,t; scanf("%lld %lld",&a,&b); c=a*b; while(t=a%b) { a=b; b=t; } printf("%lld",c/b+b); return 0; }