#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define MAXN (1000005)
int main() {
  ios_base::sync_with_stdio(false);cin.tie(0);
  ll a,b,c,d;
  cin>>a>>b>>c>>d;
  ll minimum = min(a,b);
  minimum = min(minimum,c);
  minimum = min(minimum,d);
  cout<<minimum<<'\n';
}
#include <bits/stdc++.h>
using namespace std;
const long long mod1 = 1000000007;
using ll = long long;


long long pow(long long x,long long n){
    long long ans = 1;
    while(n != 0){
        long long a = x;
        long long z = 1;
        while(z*2 <= n){
            a *=a;
            a=a%mod1;
            z*=2;
        }
        ans*=a;
        ans=ans%mod1;
        n-=z;
    }
    return ans; 
}//累乗 x^n

template<typename T>
void input_vec(vector<T> &A,long long N){
    for(int i = 0; i < N; i++){
        cin >> A.at(i);
    }
    return;
}//入力を配列で受け取る

template<typename T>
void output_vec(vector<T> &A,long long N){
    for(int i = 0; i < N; i++){
        if(i != 0){
            cout << " ";
        }
        cout << A.at(i);
    }
    cout << endl;
    return;
}//配列を出力

template<typename T>
long long count_vec(vector<T> &A,T x){
    long long counter = 0;
    for(int i = 0; i < (int)A.size(); i++){
        if(A.at(i) == x){
            counter++;
        }
    }
    return counter;
}//配列内のxの個数をreturn


vector<char> change_vec(string s,int n){
    vector<char> ans(n);
    for(int i = 0; i < n; i++){
        ans.at(i) = s.at(i);
    }
    return ans;
}//文字列を配列に変換

int main(){
    vector<ll> a(4);
    for(int i = 0; i < 4; i++){
        cin >> a.at(i);
    }
    ll small = mod1;
    for(int i = 0; i < 4; i++){
        small = min(small,a.at(i));
    }
    
    cout << small << endl;
}
