#include <iostream>
#include <algorithm> // For min and max
using namespace std;
int main() {
long long N, K, L;
cin >> N >> K >> L;
// Initialize the boundaries of the combined area
long long leftmost = 0;
long long rightmost = (N - 1) * (K + L);
long long bottommost = 0;
long long topmost = (N - 1) * (K + L);
// Iterate through each square
for (long long i = 0; i < N; ++i) {
// Calculate the boundaries of the current square
long long square_left = i * (K + L);
long long square_right = i * (K + L) + K + L - 1;
long long square_bottom = i * (K + L);
long long square_top = i * (K + L) + K + L - 1;
// Update the combined area boundaries
leftmost = min(leftmost, square_left);
rightmost = max(rightmost, square_right);
bottommost = min(bottommost, square_bottom);
topmost = max(topmost, square_top);
}
// Calculate the area of the combined area
long long area = (rightmost - leftmost + 1) * (topmost - bottommost + 1);
cout << area << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPiAvLyBGb3IgbWluIGFuZCBtYXgKCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKICBsb25nIGxvbmcgTiwgSywgTDsKICBjaW4gPj4gTiA+PiBLID4+IEw7CgogIC8vIEluaXRpYWxpemUgdGhlIGJvdW5kYXJpZXMgb2YgdGhlIGNvbWJpbmVkIGFyZWEKICBsb25nIGxvbmcgbGVmdG1vc3QgPSAwOwogIGxvbmcgbG9uZyByaWdodG1vc3QgPSAoTiAtIDEpICogKEsgKyBMKTsKICBsb25nIGxvbmcgYm90dG9tbW9zdCA9IDA7CiAgbG9uZyBsb25nIHRvcG1vc3QgPSAoTiAtIDEpICogKEsgKyBMKTsKCiAgLy8gSXRlcmF0ZSB0aHJvdWdoIGVhY2ggc3F1YXJlCiAgZm9yIChsb25nIGxvbmcgaSA9IDA7IGkgPCBOOyArK2kpIHsKICAgIC8vIENhbGN1bGF0ZSB0aGUgYm91bmRhcmllcyBvZiB0aGUgY3VycmVudCBzcXVhcmUKICAgIGxvbmcgbG9uZyBzcXVhcmVfbGVmdCA9IGkgKiAoSyArIEwpOwog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