import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        try{
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            
            String strSplit[] = br.readLine().split(" ");
            
            int result = 0;
            for(int i=0; i<strSplit.length; i++){
                if(strSplit[i].equals("0")){
                    result = i + 1;
                    break;
                }
            }
            
            System.out.println(result);
            
        }catch(Exception e){
            System.out.println(e);
        }
    }
} import java.io.*; io.* java public class Main {
    public static void main(String[] args) throws Exception {
        try{
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            
            String strSplit[] = br.readLine().split(" ");
            
            int result = 0;
            for(int i=0; i<strSplit.length; i++){
                if(strSplit[i].equals("0")){
                    result = i + 1;
                    break;
                }
            }
            
            System.out.println(result);
            
        }catch(Exception e){
            System.out.println(e);
        }
    }
} Main public static void main(String[] args) throws Exception {
        try{
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            
            String strSplit[] = br.readLine().split(" ");
            
            int result = 0;
            for(int i=0; i<strSplit.length; i++){
                if(strSplit[i].equals("0")){
                    result = i + 1;
                    break;
                }
            }
            
            System.out.println(result);
            
        }catch(Exception e){
            System.out.println(e);
        }
    } main {
        try{
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            
            String strSplit[] = br.readLine().split(" ");
            
            int result = 0;
            for(int i=0; i<strSplit.length; i++){
                if(strSplit[i].equals("0")){
                    result = i + 1;
                    break;
                }
            }
            
            System.out.println(result);
            
        }catch(Exception e){
            System.out.println(e);
        }
    } try{
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            
            String strSplit[] = br.readLine().split(" ");
            
            int result = 0;
            for(int i=0; i<strSplit.length; i++){
                if(strSplit[i].equals("0")){
                    result = i + 1;
                    break;
                }
            }
            
            System.out.println(result);
            
        }catch(Exception e){
            System.out.println(e);
        } catch(Exception e){
            System.out.println(e);
        } Exception e {
            System.out.println(e);
        } System.out.println(e) System.out.println System.out System System.out e {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            
            String strSplit[] = br.readLine().split(" ");
            
            int result = 0;
            for(int i=0; i<strSplit.length; i++){
                if(strSplit[i].equals("0")){
                    result = i + 1;
                    break;
                }
            }
            
            System.out.println(result);
            
        } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String strSplit[] = br.readLine().split(" "); strSplit br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int result = 0; result 0 for(int i=0; i<strSplit.length; i++){
                if(strSplit[i].equals("0")){
                    result = i + 1;
                    break;
                }
            } int i=0; int i=0; i 0 i<strSplit.length i strSplit.length strSplit strSplit.length i++ i++ i {
                if(strSplit[i].equals("0")){
                    result = i + 1;
                    break;
                }
            } {
                if(strSplit[i].equals("0")){
                    result = i + 1;
                    break;
                }
            } if(strSplit[i].equals("0")){
                    result = i + 1;
                    break;
                } strSplit[i].equals("0") strSplit[i].equals strSplit[i] strSplit i "0" {
                    result = i + 1;
                    break;
                } result = i + 1 result i + 1 i 1 break; System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        try{
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            
            String strSplit[] = br.readLine().split(" ");
            
            int result = 0;
            for(int i=0; i<strSplit.length; i++){
                if(strSplit[i].equals("0")){
                    result = i + 1;
                    break;
                }
            }
            
            System.out.println(result);
            
        }catch(Exception e){
            System.out.println(e);
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        try{
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            
            String strSplit[] = br.readLine().split(" ");
            
            int result = 0;
            for(int i=0; i<strSplit.length; i++){
                if(strSplit[i].equals("0")){
                    result = i + 1;
                    break;
                }
            }
            
            System.out.println(result);
            
        }catch(Exception e){
            System.out.println(e);
        }
    }
} Main
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        try{
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            
            String strSplit[] = br.readLine().split(" ");
            
            int result = 0;
            for(int i=0; i<strSplit.length; i++){
                if(strSplit[i].equals("0")){
                    result = i + 1;
                    break;
                }
            }
            
            System.out.println(result);
            
        }catch(Exception e){
            System.out.println(e);
        }
    }
}