from fractions import gcd from datetime import date, timedelta from heapq import* import math from collections import defaultdict, Counter import sys from bisect import * sys.setrecursionlimit(10 ** 7) MOD = 10 ** 9 + 7 def lcm(a, b): return a * b / gcd(a, b) def main(): t, a, b = map(int, input().split()) aa = t // a if t % a != 0: aa+=1 bb = t // b if t % b != 0: bb+=1 cc = t // int(lcm(a, b)) if t % lcm(a,b) != 0: cc +=1 print(aa + bb - cc) if __name__ == '__main__': main()