//abc185_a.cpp
//Thu Dec 17 12:35:08 2020

#include <bits/stdc++.h>
#define INTINF 2147483647
#define LLINF 9223372036854775807
#define MOD 1000000007
#define rep(i,n) for (int i=0;i<(n);++i)

using namespace std;
using ll=long long;
typedef pair<int,int> P;

int main(){
	int a[4];
	rep(i,4) cin >> a[i];

	int ans = a[0];
	rep(i,4)ans = min(ans,a[i]);

	cout << ans << endl;
//	printf("%.4f\n",ans);
}
#include<iostream>
#include<math.h>
#include<algorithm>
#include<stdint.h>
#include<vector>
#include<deque>
#include<stack>
#include<functional>
#include<string>
#include<cstring>
#include<array>
#include<fstream>
#include<iomanip>
#include<list>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<bitset>
#include<queue>
//#include<boost/multiprecision/cpp_int.hpp>

using namespace std;
//using namespace boost::multiprecision;

using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;

template<typename A, typename B> using P = pair<A, B>;

#define REP(i,a,b) for(ll i = a; i < b; ++i)
#define PRI(s) std::cout << s << endl
#define PRIF(v, n) printf("%."#n"f\n", (double)v)

template<typename A, typename B>void mins(A& a, const B& b) { a = min(a, (A)b); };
template<typename A, typename B>void maxs(A & a, const B & b) { a = max(a, (A)b); };



int main() {
	ll a, b, c, d; cin >> a >> b >> c >> d;
	PRI(min(min(min(a, b), c), d));
	return 0;
}
