#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    int a[4];
    cin>>a[0]>>a[1]>>a[2]>>a[3];
    sort(a,a+4);
    cout<<a[0];
}

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
constexpr int int_max = (1<<30)+((1<<30)-1);
constexpr int int_min = -(1<<30)-(1<<30);
constexpr ll ll_max = (1LL<<62)+((1LL<<62)-1LL);
constexpr ll ll_min = -(1LL<<62)-(1LL<<62);
int main(){
   
   int ans = INT32_MAX;
   for(int i = 0; i < 4; ++i){
       int a;
       cin >> a;
       ans = min(ans, a);
   }

   cout << ans << endl;
}
