#include<stdio.h>
#include<stdlib.h>
typedef struct TreeNode{
    int data;
    struct TreeNode *left;
    struct TreeNode *right;
}node;
node *root=NULL;
node *create (int num){
    node *newnode=(node*)malloc(sizeof(node));
    newnode->data=num;
    newnode->left=newnode->right=NULL;
    return newnode;
}
Node* insert(node *root,int num){
    if(root==NULL)return create(num);
    if(num<root->data)
    root->left=insert(root->left,num);
}
    else if(num<root->data)
    root->right=insert(root->right,num);
    return root;
}
int countnodes(node *root){
    if(root==NULL)
    return 0;
    return 1+countnodes(root->left)+countnodes(root->right);
}
int main(){
    int size,num;
    node *root=NULL;
    scanf("%d",&size);
    if(size<0){
        printf("Invalid input");
        return 0;
    }
    for(int i=0;i<size;i++){
        scanf("%d\n",&num);
        if(num<0){
            printf("Invalid input");
            return 0;
        }
    root=insert(root,num);
}
printf("%d ",countnodes(root));
return 0;
}