import java.util.*;

public class Main {
    public static void main(String[] args) {
        int count = 0;
        Scanner scanner = new Scanner(System.in);
        int n;
        int cunt = 0;
        n = scanner.nextInt();
        //write your code here......
        while(true)
        {
            if(n<0 || n == 0)
            break;
            cunt++;
            n = scanner.nextInt();
        }
        System.out.println(cunt);

    }
}