import math T,A,B = map(int, input().split()) T -= 1 M = A*B//math.gcd(A, B) print(T//A + T//B - T//M + 1)