#define _GLIBCXX_DEBUG
#include <iostream>
#include <iomanip>
#include <cctype>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int main() {
	ios::sync_with_stdio(false);

	vector<int> a(4); rep(i, 4) cin >> a[i];
	int Min=100;
	
	rep(i, 4) Min = min(Min, a[i]);
	
	cout << Min << "\n";

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