import java.util.*;
public class Main { public static void main(String[] args) { int count = 0; Scanner scanner = new Scanner(System.in);
//write your code here......
while(true){
int temp = scanner.nextInt();
if(temp<=0){
break;
}else{
count++;
}
}
System.out.print(count);
}
}