#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long;
#define rep(i,n) for (ll i=0; i < (n); ++i)
#define rep2(i,n,m) for(ll i=n;i<=m;i++)
#define rep3(i,n,m) for(ll i=n;i>=m;i--)
#define P pair<ll,ll> 
#define pb push_back
#define eb emplace_back
#define ppb pop_back
#define mpa make_pair
#define fi first
#define se second 
#define set20 cout<<fixed<<setprecision(20) ;

inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
double pi=acos(-1) ;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}



int main(){
  ll a, b,c,d ; cin>>a>>b>>c>>d ;
  ll ans= min(min(a,b),min(c,d)) ;
  cout<<ans<<endl ;
    return 0 ;
}
#include <bits/stdc++.h>
using namespace std;

int main(){
  int a[4];
  for(int i=0;i<4;i++){
    cin>>a[i];
  }
  int min=1000;
  for(int i=0;i<4;i++){
    if(a[i]<min)min=a[i];
  }
  cout<<min;
}