import math t,a,b=map(int,input().split()) print(t//a+t//b+t//math.lcm(a,b)+1)