// ConsoleApplication2.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include<math.h>
using namespace std;
int a[100000] = { 0 };
int main()
{
int t,min=10000;
cin >> t;
for (int i = 0;i < t;i++) {
cin >> a[i];
}
for (int i = 0;i < t;i++) {
if (a[i] < min) {
min = a[i];
}
}
if (min >= 0) {
cout << 0;
}
else {
int out = abs(min);
cout << out;
}
}