n,a,b = map(int,input().split()) import math ans = n//a + n//b - n//(math.lcm(a,b)) print(n-ans)