T,A,B = map(int,input().split()) na = (T-1)//A nb = (T-1)//B def gcd(a,b): while b!=0: a,b = b,a%b return a d = gcd(A,B) C = A*B//d nc = (T-1)//C print(na+nb-nc+1)