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