import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n=(long)sc.nextInt(); long m=(long)sc.nextInt(); long count=m*n; if(m>n) { long temp=m; m=n; n=temp; } long r=m%n; while (r!=0){ m=n; n=r; r=m%n; } System.out.println(n+count/n); } }