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