ソースコード
#include <iomanip>
#include <random>
#include <time.h>
#include <vector>
#include <queue>
#include <functional>
#include <map>
#include <string>
#include <cstdlib>
#include <typeinfo>
#include <math.h>
#include <algorithm>
#include <iostream>
#include <list>
#include <stack>
#include <set>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
int main() {
cin.tie(0);
ios_base::sync_with_stdio(false);
ll n, s[10], p;
cin >> n;
for (int i = 0; i < n; i++)cin >> s[i];
cin >> p;
sort(s, s + n);
if (!p)cout << s[0] << endl;
else cout << p << endl;
return 0;
}