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