import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) from math import gcd t, a, b = map(int, readline().split()) t -= 1 print(t // a + t // b - t // (a * b // gcd(a, b)) + 1)