///Bismillahir Rahmanir Rahim
#include "bits/stdc++.h"

#define                           ll                          long long
#define                           int                         ll
#define                           fi                          first
#define                           si                          second
#define                           mp                          make_pair
#define                           pb                          push_back
#define                           pi                          pair<int,int>
#define                           nd(a,b,c)                   mp(mp(a,b),c)
#define                           clr(x)                      memset(x,0,sizeof(x));
#define                           f(i,l,r)                    for(int i=l;i<=r;i++)
#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)
#define                           done(i)                     cout<<"done = "<<i<<endl;
#define                           show(x,y)                   cout<<x<<" : ";for(auto z:y)cout<<z<<" ";cout<<endl;
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

using namespace std;

const ll inf=2e18;
const int mod=1e9+7;
const int M=100005;

 main()

{
    fast
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    int ses=min(a,b);
    ses=min(ses,c);
    ses=min(ses,d);
    cout<<ses<<"\n";
    return 0;

}




































#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e5+7;

int32_t main()
{
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	cout<<min({a,b,c,d})<<endl;
}