#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
using ll = long long;
ll solve(ll N, ll K, ll L) {
// If there's only one square
if (N == 1) {
return 4LL * L * L;
}
// If squares don't overlap (K > 2L)
if (K > 2 * L) {
return N * 4LL * L * L;
}
// Calculate the area for overlapping squares
// The width of each square is 2L
ll sideLength = 2 * L;
// Calculate the total span
ll totalSpan = (N - 1) * K + 2 * L;
// The area will be totalSpan × totalSpan
return totalSpan * totalSpan;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll N, K, L;
cin >> N >> K >> L;
cout << solve(N, K, L) << "\n";
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8dmVjdG9yPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKdXNpbmcgbGwgPSBsb25nIGxvbmc7CgpsbCBzb2x2ZShsbCBOLCBsbCBLLCBsbCBMKSB7CiAgICAvLyBJZiB0aGVyZSdzIG9ubHkgb25lIHNxdWFyZQogICAgaWYgKE4gPT0gMSkgewogICAgICAgIHJldHVybiA0TEwgKiBMICogTDsKICAgIH0KICAgIAogICAgLy8gSWYgc3F1YXJlcyBkb24ndCBvdmVybGFwIChLID4gMkwpCiAgICBpZiAoSyA+IDIgKiBMKSB7CiAgICAgICAgcmV0dXJuIE4gKiA0TEwgKiBMICogTDsKICAgIH0KICAgIAogICAgLy8gQ2FsY3VsYXRlIHRoZSBhcmVhIGZvciBvdmVybGFwcGluZyBzcXVhcmVzCiAgICAvLyBUaGUgd2lkdGggb2YgZWFjaCBzcXVhcmUgaXMgMkwKICAgIGxsIHNpZGVMZW5ndGggPSAyICogTDsKICAgIAogICAgLy8gQ2FsY3VsYXRlIHRoZSB0b3RhbCBzcGFuCiAgICBsbCB0b3RhbFNwYW4gPSAoTiAtIDEpICogSyArIDIgKiBMOwogICAgCiAgICAvLyBUaGUgYXJlYSB3aWxsIGJlIHRvdGFsU3BhbiDDlyB0b3RhbFNwYW4KICAgIHJldHVybiB0b3RhbFNwYW4gKiB0b3RhbFNwYW47Cn0KCmludCBtYWluKCkgewogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7CiAgICBjaW4udGllKE5VTEwpOwogICAgCiAgICBsbCBOLCBLLCBMOwogICAgY2luID4+IE4gPj4gSyA+PiBMOwogICAgCiAgICBjb3V0IDw8IHNvbHZlKE4sIEssIEwpIDw8ICJcbiI7CiAgICAKICAgIHJldHVybiAwOwp9