import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Main {
    public static void main(String []args) throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine());
        ArrayList<Integer> num=new ArrayList<>();
        int c=1;
        while (st.hasMoreTokens()){
            int temp=Integer.parseInt(st.nextToken());
            if(temp==0)
                break;
            c++;
        }
        System.out.println(c);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.StringTokenizer; StringTokenizer java.util public class Main {
    public static void main(String []args) throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine());
        ArrayList<Integer> num=new ArrayList<>();
        int c=1;
        while (st.hasMoreTokens()){
            int temp=Integer.parseInt(st.nextToken());
            if(temp==0)
                break;
            c++;
        }
        System.out.println(c);
    }
} Main public static void main(String []args) throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine());
        ArrayList<Integer> num=new ArrayList<>();
        int c=1;
        while (st.hasMoreTokens()){
            int temp=Integer.parseInt(st.nextToken());
            if(temp==0)
                break;
            c++;
        }
        System.out.println(c);
    } main {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine());
        ArrayList<Integer> num=new ArrayList<>();
        int c=1;
        while (st.hasMoreTokens()){
            int temp=Integer.parseInt(st.nextToken());
            if(temp==0)
                break;
            c++;
        }
        System.out.println(c);
    } BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringTokenizer st=new StringTokenizer(br.readLine()); st new StringTokenizer(br.readLine()) ArrayList<Integer> num=new ArrayList<>(); num new ArrayList<>() int c=1; c 1 while (st.hasMoreTokens()){
            int temp=Integer.parseInt(st.nextToken());
            if(temp==0)
                break;
            c++;
        } st.hasMoreTokens() st.hasMoreTokens st {
            int temp=Integer.parseInt(st.nextToken());
            if(temp==0)
                break;
            c++;
        } int temp=Integer.parseInt(st.nextToken()); temp Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st if(temp==0)
                break; temp==0 temp 0 break; c++ c System.out.println(c) System.out.println System.out System System.out c String []args args public class Main {
    public static void main(String []args) throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine());
        ArrayList<Integer> num=new ArrayList<>();
        int c=1;
        while (st.hasMoreTokens()){
            int temp=Integer.parseInt(st.nextToken());
            if(temp==0)
                break;
            c++;
        }
        System.out.println(c);
    }
} public class Main {
    public static void main(String []args) throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine());
        ArrayList<Integer> num=new ArrayList<>();
        int c=1;
        while (st.hasMoreTokens()){
            int temp=Integer.parseInt(st.nextToken());
            if(temp==0)
                break;
            c++;
        }
        System.out.println(c);
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Main {
    public static void main(String []args) throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine());
        ArrayList<Integer> num=new ArrayList<>();
        int c=1;
        while (st.hasMoreTokens()){
            int temp=Integer.parseInt(st.nextToken());
            if(temp==0)
                break;
            c++;
        }
        System.out.println(c);
    }
}
