import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> list=new ArrayList<>();
        for(int i=0;i<5;i++){
            list.add(sc.nextInt());
        }
        System.out.println(list.indexOf(0)+1);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> list=new ArrayList<>();
        for(int i=0;i<5;i++){
            list.add(sc.nextInt());
        }
        System.out.println(list.indexOf(0)+1);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> list=new ArrayList<>();
        for(int i=0;i<5;i++){
            list.add(sc.nextInt());
        }
        System.out.println(list.indexOf(0)+1);
    } main {
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> list=new ArrayList<>();
        for(int i=0;i<5;i++){
            list.add(sc.nextInt());
        }
        System.out.println(list.indexOf(0)+1);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) ArrayList<Integer> list=new ArrayList<>(); list new ArrayList<>() for(int i=0;i<5;i++){
            list.add(sc.nextInt());
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            list.add(sc.nextInt());
        } {
            list.add(sc.nextInt());
        } list.add(sc.nextInt()) list.add list sc.nextInt() sc.nextInt sc System.out.println(list.indexOf(0)+1) System.out.println System.out System System.out list.indexOf(0)+1 list.indexOf(0) list.indexOf list 0 1 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> list=new ArrayList<>();
        for(int i=0;i<5;i++){
            list.add(sc.nextInt());
        }
        System.out.println(list.indexOf(0)+1);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> list=new ArrayList<>();
        for(int i=0;i<5;i++){
            list.add(sc.nextInt());
        }
        System.out.println(list.indexOf(0)+1);
    }
} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> list=new ArrayList<>();
        for(int i=0;i<5;i++){
            list.add(sc.nextInt());
        }
        System.out.println(list.indexOf(0)+1);
    }
}