#include <bits/stdc++.h>
using namespace std;
const int N = 200500;
int w[4];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  for (int i = 0, qwerty = 4; i < qwerty; i++) cin >> w[i];
  long long ans = w[0] * 2LL + w[1] * 2 + 4 + 2 * w[3];
  cout << ans << "\n";
}
