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