#include<stdio.h>
#include<stdlib.h>
struct node {
    int data;
    struct Node* next;
};
int main() {
    int n,i,value;
    struct Node *head = NULL,*temp = NULL,*newnode = NULL;
    scanf("%d",&n);
    if(n<0) {
        printf("Invalid input");
        return 0;
    }
    for(i=0;i<n;i++) {
        scanf("%d",&value);
        newnode=(struct Node*)malloc(sizeof(struct Node));
        newnode->data = value;
        newnode->next = NULL;
        if(head == NULL)
        head = newnode;
        else
        temp->next = newnode;
        temp = newnode;
    }
    int count = 0;
    temp = head;
    while(temp != NULL) {
        count++;
        temp = temp->next;
    }
    printf("%d", count);
    return 0;
}