T,a,b=map(int,input().split()) T-=1 import math g=a*b//(math.gcd(a,b)) ans=T//a+ T//b-T//g print(ans+1)