#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
long long int a, b, c, d, e, f, g, h[100005], arr[100005];
string s;
vector<long long int> v;
char ch;
int main() {
  cin >> a >> b >> c >> d;
  cout << 2 * (a + b + d) + 4;
}
