#include<iostream>
using namespace std;

int main()
{
    int n;
    int min = 100000;
    for (int i = 1; i <= 4;i++){
        cin >> n;
        if(n<min)
            min = n;
    }
    cout << min;
    return 0;
}
#include <bits/stdc++.h>
#include <string>
#include <cmath>
using namespace std;

#define ll long long int
#define pb push_back
#define RONALDO ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pii pair<ll, ll>
#define ff first
#define ss second
#define mod 1000000007
#define vi vector<ll>
#define mi map<ll, ll>
#define Max(x, y, z) max(x, max(y, z))
#define Min(x, y, z) min(x, min(y, z))

//LOVE U MEssi10 && ROnaldo7 !!

//INSPIRATIONAL MICHAEL PHELPS && USAIN BOLT !!

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