#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<(n);++i)
using ll = long long;
using p = pair<int,int>;

int main() {
	int a1,a2,a3,a4;
	cin >> a1 >> a2 >> a3 >> a4;
	int ans = a1;
	if(ans > a2) ans = a2;
	if(ans > a3) ans = a3;
	if(ans > a4) ans = a4;
	cout << ans << endl;
	  return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define f(i,n) for(int i=0;i<n;i++)
#define pb push_back
#define ff first
#define ss second
#define ll long long
#define mod 1000000007
#define ps(x,y)   fixed<<setprecision(y)<<x
#define inp(a,n) for(int i=0;i<n;i++) cin>>a[i];
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int main() 
{

    FIO;
    int t=1;
    // cin>>t;
    while(t--)
    {
       int a,b,c,d;
       cin>>a>>b>>c>>d;
       cout<<min(min(a,b),min(c,d))<<endl;
    }
return 0;   
}