#include<iostream>
using namespace std;
int main()
{
int n, a[110];
cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> a[i];
}
for (int i = 0; i < 110 - 1; i++)
{
for (int j = 0; j < 110 - i - 1; j++)
{
if (a[j] > a[j + 1])
{
int temp = a[j];
a[j + 1] = a[j];
a[j + 1] = temp;
}
}
}
cout << a[n] << endl;
system("pause");
return 0;
}