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