#include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define el endl
#define nl '\n'
#define all(v) v.begin(), v.end()
using namespace std;

void input()
{
    if (fopen("in.txt", "r"))
    {
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    }
}

void init()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
}
int main()
{
Fast:
    input();
    init();
    //---------------------------------------------------------------------------------------------------------------
    int n, MaxNum = INT_MIN;

    cin >> n;
    int ar[n];
    for (int i = 0; i < n; i++)
    {
        cin >> ar[i];

        if (ar[i] > MaxNum)
            MaxNum = ar[i];
    }
    cout << MaxNum << nl;

    return 0;
}