import math T,A,B=map(int,input().split()) C=math.lcm(A,B) print(T//A+T//B-T//C+1)