#include<bits/stdc++.h>
using namespace std;
int main(){
    int s=100;vector<int>v(4);
    for(int i=0;i<4;i++){
        cin>>v[i];
        if(s>v[i])s=v[i];
    }
    cout<<s<<endl;
}

#include<bits/stdc++.h>

#define ll long long
#define eb emplace_back

using namespace std;
const int mx= 1e3 + 10;
 
 


	
	
void solve(){
	
	int a, b , c , d;
	
	cin >> a >> b >> c >> d;
	
	cout << min(a, min(c , min(b,d)));
}
	
int main(){
	
	ios_base::sync_with_stdio(0);
	
	cin.tie(0);
 
	int t;
	
	//cin>>t;
	t=1;
    while(t--) {
		solve();
    }
    
	
	
	return 0;
}
 

	 
 

 

 
