#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;
}

#include<bits/stdc++.h>
using namespace std;

int main(void){
  int AB[2], CD[2], value;
  for(int i = 0; i < 2; i++)
    cin >> AB[i];
  for(int i = 0; i < 2; i++)
    cin >> CD[i];
  sort(begin(AB), end(AB));
  sort(begin(CD), end(CD));
  value = AB[0] + CD[0];
  cout << value << "\n";
  return 0;
}
