#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define pb push_back
#define int long long int
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define vvi vector < vi >
#define pii pair<int,int>
#define pll pair<long long, long long>
#define F first
#define S second
#define mod 1000000007
#define MOD 998244353
#define inf 1000000000000000001;
#define all(c) c.begin(),c.end()
#define deb(x) cout<< ">" << #x << '=' << x << endl;
#define read(v) for(auto &it:v) cin>>it;
const int  N = 2e5 + 5;
void solve() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	cout << min({a, b, c, d}) << endl;



}
signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int  t = 1;
	//cin >> t;
	while (t--) solve();
	return 0;
}
#include <bits/stdc++.h>
using namespace std;

int main(){
    vector<int> A(4);
    for(int i=0;i<4;i++) cin >> A[i];
    int ans = 99999;

    for(int i=0;i<4;i++){
        ans = min(ans,A[i]);
    }

    cout << ans << endl;

    return 0;
}