#include<iostream>
#include<math.h>
using namespace std;

int main(void){
  int a[100]={};
  int min=INFINITY;
  
  for(int i=0;i<4;i++){
    cin >> a[i];
  }
  for(int i=0;i<4;i++){
    if(min>a[i]){
      min=a[i];
    }
  }
  cout << min;
  return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define p pair<long long,long long>
#define endl '\n'
#define iof  freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define pi acos(-1)
int fx[]={0,0,1,-1,1,1,-1,-1};
int fy[]={1,-1,0,0,-1,1,-1,1};
const int mxn=1e9+7;

int main(int argc, char const *argv[])
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(0);
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    int mn=min({a,b,c,d});
    cout<<mn<<endl;
}
