#include "bits/stdc++.h" using namespace std; void solve(void) { long h, w; cin >> h >> w; cout << (w + h - 1) / w * 2 * h << endl; } int main() { solve(); //cout << "yui(*-v・)yui" << endl; return 0; }