#include <iostream>
#include <algorithm>
using namespace std;
int main() {
long long n, x, y;
cin >> n >> x >> y;
if (x > y) {
swap(x, y); // Ensure x is always the faster one
}
// Binary search over time to find the minimum time required
long long low = 0, high = (n - 1) * y; // Maximum time possible
long long answer = high;
while (low <= high) {
long long mid = (low + high) / 2;
// How many copies can be made in 'mid' seconds
long long copies = mid / x + mid / y;
// We already have the original copy, so we need (n - 1) more copies
if (copies >= n - 1) {
answer = mid;
high = mid - 1; // Try to find a smaller time
} else {
low = mid + 1; // Increase the time
}
}
// Add the time for the first copy
cout << answer + x << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICBsb25nIGxvbmcgbiwgeCwgeTsKICAgIGNpbiA+PiBuID4+IHggPj4geTsKCiAgICBpZiAoeCA+IHkpIHsKICAgICAgICBzd2FwKHgsIHkpOyAvLyBFbnN1cmUgeCBpcyBhbHdheXMgdGhlIGZhc3RlciBvbmUKICAgIH0KCiAgICAvLyBCaW5hcnkgc2VhcmNoIG92ZXIgdGltZSB0byBmaW5kIHRoZSBtaW5pbXVtIHRpbWUgcmVxdWlyZWQKICAgIGxvbmcgbG9uZyBsb3cgPSAwLCBoaWdoID0gKG4gLSAxKSAqIHk7IC8vIE1heGltdW0gdGltZSBwb3NzaWJsZQogICAgbG9uZyBsb25nIGFuc3dlciA9IGhpZ2g7CgogICAgd2hpbGUgKGxvdyA8PSBoaWdoKSB7CiAgICAgICAgbG9uZyBsb25nIG1pZCA9IChsb3cgKyBoaWdoKSAvIDI7CgogICAgICAgIC8vIEhvdyBtYW55IGNvcGllcyBjYW4gYmUgbWFkZSBpbiAnbWlkJyBzZWNvbmRzCiAgICAgICAgbG9uZyBsb25nIGNvcGllcyA9IG1pZCAvIHggKyBtaWQgLyB5OwoKICAgICAgICAvLyBXZSBhbHJlYWR5IGhhdmUgdGhlIG9yaW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