#include <stdio.h>
#include <stdlib.h>

typedef struct Node {
    int data;
    struct Node *left, *right;
} Node;

Node* createNode(int data) {
    Node* newNode = (Node*)malloc(sizeof(Node));
    newNode->data = data;
    newNode->left = newNode->right = NULL;
    return newNode;
}

Node* addNode(Node* node, int data) {
    if (node == NULL)
    return createNode(data);
    
    if (data < node->data)
    node->left = addNode(node->left, data);
    else(data > node->data)
    node->right = addNode(node->right, data);
    
    return node;
}

int count = 0, valid[100];
void countNodes(Node *node){
    if(node==NULL)return;
    count++;
    countNodes(node->left);
    countNodes(node->right);
}

int main() {
    int n, data;
    scanf("%d", &n);
    
    if (n <= 0) {
        printf("Invalid input");
        return 0;
    }
    
    Node* root = NULL;
    for (int i = 0; i < n; i++) {
        if (scanf("%d", &data) != 1) {
            printf("Invalid input");
            return 0;
        }
        if (data < 0) {
            printf("Invalid input");
            return 0;
        }
        root = addNode(root, data);
    }
    
    printf("%d", countNodes(root));
    
    return 0;
}