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