const args = process.argv.slice(2);

const inputA = args[0];
const inputB = args[1];
let i = 1;
let answer = 0;
let answerA = Number(inputA);
let answerB = Number(inputB);

do {
    i = i+1;
    answerA = Number(inputA);
    answerA = i / answerA;
    answerB = Number(inputB);
    answerB = i / answerB;
} while(Number.isInteger(answerA) === false || Number.isInteger(answerB) === false);

console.log(i);