const stdin = require("fs").readFileSync("/dev/stdin", "UTF8"); const [t, a, b] = stdin.split(/\S/).filter(x=>x).map(x=>BigInt(x)); function gcd(a, b) { function gcd_core(a, b) { return b ? gcd_core(b, a % b) : a; } return a > b ? gcd_core(a, b) : gcd_core(b, a); } const g = gcd(a, b); const l = a * b / g; const bus1 = (t + a - 1) / a; const bus2 = (t + b - 1) / b; const busomni = (t + l - 1) / l; console.log(bus1 + bus2 - busomni);