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

typedef long long              ll;
typedef long double            ld;
typedef pair<int, int>         pi;
typedef vector<int>            vi;
typedef vector<long long>      vll;
typedef vector<pair<int, int>> vpi;

#define pb            push_back
#define pf            push_front
#define all(x)        begin(x), end(x)
#define sz(x)         (int)(x).size()
#define ff            first
#define ss            second
#define mp            make_pair
#define lb            lower_bound
#define ub            upper_bound
#define Tcase()       int tcc; cin >> tcc; while(tcc--)
#define FOR(i, a, b)  for(int i = (a); i < (b); i++)
#define F0R(i, a)     FOR(i, 0, a)

const ll  MOD   = 998244353;
const ll  INF   = 9e18;
const int MX    = 2e5 + 5;
const ld  PI    = acos((ld) -1);
const int dx[8] = {0, 1, 0, -1, 1, -1, 1, -1};
const int dy[8] = {1, 0, -1, 0, 1, -1, -1, 1};

void setIO(string name = "") {
    ios_base::sync_with_stdio(0); cin.tie(0);
    if(sz(name)){
        freopen((name+".in").c_str(), "r", stdin);
        freopen((name+".out").c_str(), "w", stdout);
    }
}

int main(){

    setIO();

    int a, b, c, d;
    cin >> a >> b >> c >> d;

    cout << min({a, b, c, d});
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define cases() ll t;cin>>t;while(t--)
#define pb push_back
#define ff first
#define ss second
#define light ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
const ll MAX = 1e5+5;
const ll INF = 1e18;
const ll MOD = 1e9+7 ;

int main()
{
    vector<int> a(4);
    int i;
    for(i=0;i<4;i++)
        cin >> a[i];
    cout << *min_element(a.begin(),a.end());
}