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