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