#include <iostream>
#include <cmath>

using namespace std;

int main(){
  int minimum;
  cin >> minimum;
  
  for (int i = 0; i < 3; i++){
    int temp;
    cin >> temp;
    minimum = min(minimum, temp);
  }
  cout << minimum << endl;
}
/***

..*.*... \O/..*..*
*.....*...|....*...
*......../.\....*..*

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