#include<bits/stdc++.h>
using namespace std;
int a[5];
int ans=99999999;
int main()
{
	for(int i=1;i<=4;i++)
	{
		cin>>a[i];
		ans=min(ans,a[i]);
	}
	cout<<ans;
	return 0;
}
/***
 
                                Bismillahir Rahmanir Rahim
                                Rabbi Zidni Ilma
                                Author : Saidur Rahman
                                Department of CSE, City University, Bangladesh.
 
***/
 
#include<bits/stdc++.h>
using namespace std;
 
 
 
#define         endl                "\n"
#define         EPS                 1e-6
#define         F                   first
#define         sf                  scanf
#define         pf                  printf
#define         S                   second
#define         done                return 0
#define         MP                  make_pair
#define         pb                  push_back
#define         start               int main()
#define         PI                  acos(-1.0)
#define         NO                  cout<<"NO\n"
#define         No                  cout<<"No\n"
#define         no                  cout<<"no\n"
#define         YES                 cout<<"YES\n"
#define         Yes                 cout<<"Yes\n"
#define         yes                 cout<<"yes\n"
#define         sz(x)               int(x.size())
#define         all(a)              a.begin(),a.end()
#define         srt(x)              sort(x.begin(),x.end())
#define         clock_start         clock_t tStart = clock()
#define         MEM(a, b)           memset(a, (b), sizeof(a))         
#define         watch(x)            cout << (#x) << " is " << (x) << endl
#define         Fast                ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define         show_time           cout<<"\n\nTime Taken: "<<fixed<<setprecision(3)<<(double)(clock() - tStart) /  CLOCKS_PER_SEC<<"s"
 

            /****** Template of some bit operations *****/

int         ToggleBit (int n, int X)    { return n ^ (1 << X); }
int         SetBit (int n, int X)       { return n | (1 << X); }
int         ClearBit (int n, int X)     { return n & ~(1 << X); }
bool        CheckBit (int n, int X)     { return (bool)(n & (1 << X)); }
 

            ///////////////////////////////////////////////////////////////////////////
        ///////////////////////// DO NOT TOUCH BEFORE THIS LINE //////////////////////////
            //////////////////////////////////////////////////////////////////////////
 
 
typedef     long long   ll;
const       int MAXN = 1e5 + 1;
const       int MOD  = 1e9 + 7;
const       int INF  = 1e9;
const       ll LINF  = 1e18;





start
{
    Fast;

#ifndef ONLINE_JUDGE
    clock_start;
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    int a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<min(min(a,b),min(c,d))<<endl;





#ifndef ONLINE_JUDGE 
    show_time;
#endif

    done;
}
