n, x, y = map(int, input().split()) low, high = 1, n * min(x, y) ans = -1 while low <= high: mid = (low + high) // 2 total = (mid // x) + (mid // y) if total < n: low = mid + 1 else: high = mid - 1 ans = mid print(ans)