T,A,B=map(int,input().split())

import math
C=A*B//math.gcd(A,B)
T-=1

print(T//A+T//B-T//C+1)