import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] nm = br.readLine().split(" "); long n = Integer.parseInt(nm[0]); long m = Integer.parseInt(nm[1]); long gcd = 1, lcm = n * m; if (n < m) n = m + n - (m = n); long temp = m % n; while (temp != 0) { m = n; n = temp; temp = m % n; } gcd = n; lcm /= gcd; System.out.print(gcd + lcm); } }