#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <class T>
void __printArray(T ara[], long long seez) {
  cerr << "{ ";
  for (long long i = 0; i < seez; i++) {
    cerr << ara[i];
    if (i != seez - 1) cerr << ",";
  }
  cerr << " }\n";
}
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
const int big = INT_MAX;
const int smol = INT_MIN;
const long long mod = 1e9 + 7;
const int INT5 = 1e5 + 5;
const int INT6 = 1e6 + 6;
const int INT7 = 1e7 + 7;
const int INT8 = 1e8 + 8;
const long long INT9 = 1e9 + 9;
const long long INT12 = 1e12 + 12;
template <class T>
inline T power_fast(T base, T exp, long long md) {
  base %= md;
  T result = 1;
  for (; exp > 0; exp >>= 1) {
    if (exp & 1) result = (result * base) % md;
    base = (base * base) % md;
  }
  return (T)result;
}
template <class T>
inline T power_fast(T base, T exp) {
  T result = 1;
  for (; exp > 0; exp >>= 1) {
    if (exp & 1) result = (result * base);
    base = (base * base);
  }
  return (T)result;
}
template <class T>
inline T power_of_two(T xnxx) {
  return (T)1 << xnxx;
}
template <class T>
inline bool isPowerOfTwo(T x) {
  return x && (!(x & (x - 1)));
}
template <class T>
inline string convert_to_string(T n) {
  stringstream x;
  x << n;
  return x.str();
}
template <class T>
inline T return_randomNum(T min, T max) {
  return min + (rand() % max);
}
template <class T>
inline T random_number_generator(T min, T max) {
  srand((unsigned)time(nullptr));
  return_randomNum(min, max);
}
template <class T>
inline void reduceFraction(T x, T y) {
  T d;
  d = __gcd(x, y);
  x = (x / d);
  y = (y / d);
  cout << x << "/" << y << endl;
}
inline bool isPerfectSquare(long double x) {
  if (x >= 0) {
    long long sr = (x);
    return (sr * sr == x);
  }
  return false;
}
inline bool check_for_substring(string str, string str2) {
  if (str.find(str2) != string::npos) {
    return true;
  } else
    return false;
}
template <class T>
inline void SETARRAY(T *arrr, T arrrsize, T val) {
  for (int i = 0; i < arrrsize; i++) arrr[i] = val;
}
void testCases() {
  fstream file1("output.txt"), file2("realoutput.txt");
  char string1[256], string2[256];
  int j;
  j = 0;
  bool isAccepted = true;
  while (!file1.eof()) {
    file1.getline(string1, 256);
    file2.getline(string2, 256);
    j++;
    if (strcmp(string1, string2) != 0) {
      string fsldkf = " ";
      if (string2 == fsldkf) continue;
      cout << "Test case " << j << " Wrong Answer"
           << "\n";
      cout << "Output:   |" << string1 << "\n";
      cout << "Expected:   |" << string2 << "\n";
      isAccepted = false;
      cout << "\n";
      ;
    }
  }
  if (isAccepted) cout << "Accepted\n";
}
void fileoj(bool file) {}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  fileoj(0);
  int tc = 1;
  while (tc--) {
    int n;
    cin >> n;
    int dollars = 0;
    for (size_t i = 0; i < n; i++) {
      int x;
      cin >> x;
      dollars = max(dollars, x);
    }
    cout << dollars << endl;
  }
  return 0;
  ;
}
