#include<bits/stdc++.h>
using namespace std;
#define ll  long long

ll a, b;

void calculate_sides(ll num) {
    num /= 2;
    a = num / 2;
    b = num - a;
}

ll solve(ll n, ll m) {
    if (n < 2) {
        calculate_sides(m);
        return (2 * a) * (2 * b);
    }
    if (n > 3) {
        calculate_sides(n + 2 * m);
        return a * b;
    }
    // 2 <= n <= 3
    if (m % 2) {
        calculate_sides(m + 1);
        return (2 * a) * (2 * b);
    }
    else {
        calculate_sides(m);
        return (2 * a + 1) * (2 * b);
    }
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    ll n, m; cin >> n >> m;
    cout << solve(n, m) << endl;

    return 0;
}
