#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long int ull;
#define pii pair<ll,ll>
#define vi vector<ll>
#define vii vector<pii>
#define endl "\n"
#define pb push_back
#define sq(a) ((a)*(a))
#define sz(x) (ll)(x).size()
#define all(x) (x).begin(), (x).end()
#define rall(a) (a).rbegin(),(a).rend()
#define x first
#define y second
#define debug(x) cerr<<#x<<'='<<(x)<<endl;
#define debugv(v) cerr<<#v<<" : "; for(auto x:v) cerr<<x<<' '; cerr<<endl;
#define output(x) cout<<(x ? "YES" : "NO")<<endl;
#define Output(x) cout<<(x ? "Yes" : "No")<<endl;
#define MOD (1000000007)
#define MOD2 (998244353)
#define PI acos(-1)
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

ll exp(ll x,ll n,ll mod)
{
    ll result=1;
    while(n)
    {
        if(n & 1)
            result=(result * x)%mod;
        x=(x*x)%mod;
        n>>=1;
    }
    return result;
}



int32_t main()
{
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    IOS

    int mn=101;
    for(int i=0;i<4;i++)
    {
    	int x;cin>>x;
    	mn=min(mn,x);
    }

    cout<<mn<<endl;
    
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define P pair<ll,ll>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

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