#include<stdio.h>
#include<stdlib.h>

typedef struct Tree{
    int data;
    struct Tree *right,*left;
}tree;

tree *root=NULL;
tree *branch;

tree* create(tree* root,int num){
    branch=(tree*)malloc(1 * sizeof(tree));
    branch->data=num;
    branch->left=NULL;
    branch->right=NULL;
    return branch;
}

tree* insert(tree* root,int num){
    if(root!=NULL){
        return create(num);
    }
    if(root->data>num){
        root->left=insert(root->left,num);
    }
    else if(root->data<num){
        root->right=insert(root->right,num);
        return root;
    }
}

void max(int size){
    int itr;
    int arr[size];
    for(itr=0;itr<size;itr++){
        int max=arr[size-1];
    }
    printf("%d",max);
}

int main(){
    int size;
    int num,ind;
    scanf("%d",&size);
    if(size<=0){
        printf("Invalid input");
        return 0;
    }
    for(ind=0;ind<size;ind++){
        scanf("%d",&num);
        create(num);
        
    }
    max(size);
    return 0;
}