#include <algorithm>
#include <array>
#include <cassert>
#include <iostream>
#include <vector>
#include <string>


using namespace std;

void solve()
{
	string x;
	cin >> x;

	int ans = x[0] - '0';

	ans = x.size() * 10;
	
	cout << ans << endl;


} 

int main()
{
	int a, b, c, d;
	cin >> a >> b >> c >> d;

	vector<int> v;

	v.push_back(a);
	v.push_back(b);
	v.push_back(c);
	v.push_back(d);

	sort(v.begin(), v.end());

	cout << v[0] << endl;
}

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

template <class A, class B> bool cmin(A& a, B b) { return a > b && (a = b, true); }
template <class A, class B> bool cmax(A& a, B b) { return a < b && (a = b, true); }

signed main() {
  cin.tie(nullptr)->sync_with_stdio(false);

  int N = 4;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A.at(i);

  cout << *min_element(A.begin(), A.end()) << '\n';
}