from sys import stdin ## input functions for me def ria(sep = ''): if sep == '' : return list(map(int, input().split())) else: return list(map(int, input().split(sep))) def rsa(sep = ''): if sep == '' : return input().split() else: return input().split(sep) def ri(): return int(input()) def rd(): return float(input()) def rs(): return input() ## def gcd(a, b): return b if a == 0 else gcd(b % a, a) ## main ## t, a, b = map(int, input().split()) lcm = a * b / gcd(a, b) ca = (t + a - 1) // a cb = (t + b - 1) // b cc = (t + lcm - 1) // lcm print(int(ca + cb - cc))