#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long lenght, widh, guards;
    cin >> lenght >> widh;
    guards = 2 * widh;
    long long mod = widh % 2, NumberGuards = widh / 2 - 1;
    long long realyLenth = lenght - 2;
    guards += (realyLenth / 2 + (realyLenth % 2)) * (NumberGuards  + 2);
    guards += realyLenth / 2 * (NumberGuards + mod + 2);
    cout << guards << endl;
    
    return 0;
}