#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,d,ans;
    while(cin >> a >> b >> c >> d){
        ans = 0;
        ans+=min(a,b);
        ans+=min(c,d);
        cout << ans << endl;
    }
}

#include <algorithm>
#include <iostream>

using namespace std;
using ll = long long;
using ld = long double;

#define ALL(x) begin(x), end(x)
#define REP(i, n) for (size_t i = 0, i##_len = (n); i < i##_len; ++i)

void solve(ll A, ll B, ll C, ll D) {
  cout <<   min(A,B) + min(C,D) << endl;
}

int main() {
  ll A;
  cin >> A;
  ll B;
  cin >> B;
  ll C;
  cin >> C;
  ll D;
  cin >> D;
  solve(A, B, C, D);
  return 0;
}
