from math import gcd N, A, B = map(int, input().split()) L = A * B // gcd(A, B) print(N - (N // A) - (N // B) + (N // L))