#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); ++i)
double const PI = 3.1415926535897932384626433;
using P = pair<int, int>;

int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << min(a, b) + min(c, d) << endl;
    return 0;
}
#include<stdio.h>
int main()
{
	long long int a,ans;
    long double b,s;
	scanf("%lld %Lf",&a,&b);
	s=a*b;
	ans=s;
	printf("%lld",ans);
}