import std; void main() { long T, A, B; readf("%d %d %d\n", T, A, B); long C = A / gcd(A, B) * B; long res = (T - 1) / A + (T - 1) / B - (T - 1) / C + 1; res.writeln; }