from fractions import gcd T, A, B = map(int, input().split()) ans = 1 + (T-1)//A + (T-1)//B - (T-1) // (A*B //gcd(A, B)) print(ans)