#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
#include <utility>
typedef long long ll;
const int INF = 1e9+1;
const int MOD = 2e9 + 9;
const ll LINF = 1e18;
using namespace std;

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

int main()
{
    int n, input;
    cin >> n;

    int mn = n, cnt = 0;

    for(int i = 0; i < n; i++){
        cin >> input;
        if(input < mn)
            mn = input;
        if(mn >= input)
            cnt++;
    }

    cout << cnt;


    return 0;
}
