import math N,a,b=map(int,input().split()) max_ab=math.gcd(a,b) a_times=N//a b_times=N//b ab_times=(N//max_ab) + 1 ans=a_times+b_times+a_times print(ans)