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