import sys input=lambda: sys.stdin.readline().rstrip() t,a,b=map(int,input().split()) def gcd(a,b): while b: a,b=b,a%b return a m=a*b//gcd(a,b) print((t-1)//a+(t-1)//b-(t-1)//m+1)