#include<stdio.h>
void main(){
int lineCount,temp;
while((temp=getchar())!=EOF){
if(temp=='\n')
++lineCount;
if(temp=='~')
break;
}
printf("%d",lineCount);
}
void main(){
int lineCount,temp;
while((temp=getchar())!=EOF){
if(temp=='\n')
++lineCount;
if(temp=='~')
break;
}
printf("%d",lineCount);
}