#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)n; i++)
using ll = long long;

int main(){
  int a[4];
  int ans = 100;
  rep(i,4) {
    cin >> a[i];
    ans = min(ans,a[i]);
  }
  cout << ans << endl;
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
int a1,a2,a3,a4;
int main(){
	cin>>a1>>a2>>a3>>a4;
	cout<<min(a1,min(a2,min(a3,a4)));
	return 0;
}