from math import* n,a,b=map(int,input().split()) g=gcd(a,b) l=a*b//g print(n-n//a-n//b+n//l)