#include<stdio.h>
#include<stdlib.h>
typedef struct node{
    int data;
    struct node* left;
    struct node* right;
}node;
node* createnode(int data){
    node* newnode=(node*)malloc(sizeof(node));
    newnode->data=data;
    newnode->left=newnode->right= NULL;
    return newnode;
}
node* insert (node* root,int data){
    if(root== NULL){
        return createnode(data);
    }
    if(data < root->data){
        root->left = insert(root->left,data); 
    }else{
        root->right =insert(root->right,data);
    }
    return root;
}
int findmin(node* root){
    if(root == NULL) return 0;
    while(root->left != NULL){
        root = root->left;
    }
    return root->data;
}
int main()
int c;
  if (scanf("%d",&c)!=1||c<=0){
    printf("Invalid input\n");
    return 0;
}
node* root = NULL;
    int value;
for (int i = 0 ; i < c; i++){
    if (scanf("%d",&value)!=1){
        printf("Invalid input\n");
        return o;
    }
    root= insert (root, value);
}
printf ("%d\n",findmin(root));
     return 0;
}