from math import gcd t, a, b = list(map(int, input().split())) lcm = a * b // gcd(a, b) ca = (t+a-1)//a cb = (t+b-1)//b clcm = (t+lcm-1)//lcm print(ca+cb-clcm)