MOD = 10 ** 9 + 7 INF = 10 ** 10 import sys sys.setrecursionlimit(100000000) dy = (-1,0,1,0) dx = (0,1,0,-1) from math import gcd def lcm(a,b): return a*b//gcd(a,b) def main(): t,a,b = map(int,input().split()) t -= 1 g = lcm(a,b) ans = t//a + t//b - t//g + 1 print(ans) if __name__ =='__main__': main()