import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;

public class Main {
    
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);

        String[] input_array = br.readLine().split(" ");
        int result = 0;

        for(String str : input_array)  {
            result += 1;
            if("0".equals(str)) break;
        }

        pw.println(result);
        br.close();
        pw.close();
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.PrintWriter; PrintWriter java.io public class Main {
    
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);

        String[] input_array = br.readLine().split(" ");
        int result = 0;

        for(String str : input_array)  {
            result += 1;
            if("0".equals(str)) break;
        }

        pw.println(result);
        br.close();
        pw.close();
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);

        String[] input_array = br.readLine().split(" ");
        int result = 0;

        for(String str : input_array)  {
            result += 1;
            if("0".equals(str)) break;
        }

        pw.println(result);
        br.close();
        pw.close();
    } main {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);

        String[] input_array = br.readLine().split(" ");
        int result = 0;

        for(String str : input_array)  {
            result += 1;
            if("0".equals(str)) break;
        }

        pw.println(result);
        br.close();
        pw.close();
    } BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in)); br new BufferedReader(new java.io.InputStreamReader(System.in)) PrintWriter pw = new PrintWriter(System.out); pw new PrintWriter(System.out) String[] input_array = br.readLine().split(" "); input_array br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int result = 0; result 0 for(String str : input_array)  {
            result += 1;
            if("0".equals(str)) break;
        } String str input_array {
            result += 1;
            if("0".equals(str)) break;
        } {
            result += 1;
            if("0".equals(str)) break;
        } result += 1 result 1 if("0".equals(str)) break; "0".equals(str) "0".equals "0" str break; pw.println(result) pw.println pw result br.close() br.close br pw.close() pw.close pw String[] args args public class Main {
    
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);

        String[] input_array = br.readLine().split(" ");
        int result = 0;

        for(String str : input_array)  {
            result += 1;
            if("0".equals(str)) break;
        }

        pw.println(result);
        br.close();
        pw.close();
    }
} public class Main {
    
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);

        String[] input_array = br.readLine().split(" ");
        int result = 0;

        for(String str : input_array)  {
            result += 1;
            if("0".equals(str)) break;
        }

        pw.println(result);
        br.close();
        pw.close();
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;

public class Main {
    
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);

        String[] input_array = br.readLine().split(" ");
        int result = 0;

        for(String str : input_array)  {
            result += 1;
            if("0".equals(str)) break;
        }

        pw.println(result);
        br.close();
        pw.close();
    }
}