from fractions import gcd def lcm(a, b): return a * b / gcd(a, b) def main(): T, A, B = map(int, input().split()) C = int(lcm(A, B)) cnt1 = T // A - 1 if T % A == 0 else T // A cnt2 = T // B - 1 if T % B == 0 else T // B cnt3 = T // C - 1 if T % C == 0 else T // C print(cnt1 + cnt2 - cnt3 + 1) if __name__ == "__main__": main()