import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int idx = 0;
        for(int i=0;i<5;i++){
            if(sc.nextInt()==0)
                idx = i;
        }
        System.out.println(++idx);
    }

} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int idx = 0;
        for(int i=0;i<5;i++){
            if(sc.nextInt()==0)
                idx = i;
        }
        System.out.println(++idx);
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int idx = 0;
        for(int i=0;i<5;i++){
            if(sc.nextInt()==0)
                idx = i;
        }
        System.out.println(++idx);
    } main {
        Scanner sc = new Scanner(System.in);
        int idx = 0;
        for(int i=0;i<5;i++){
            if(sc.nextInt()==0)
                idx = i;
        }
        System.out.println(++idx);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int idx = 0; idx 0 for(int i=0;i<5;i++){
            if(sc.nextInt()==0)
                idx = i;
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            if(sc.nextInt()==0)
                idx = i;
        } {
            if(sc.nextInt()==0)
                idx = i;
        } if(sc.nextInt()==0)
                idx = i; sc.nextInt()==0 sc.nextInt() sc.nextInt sc 0 idx = i idx i System.out.println(++idx) System.out.println System.out System System.out ++idx idx String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int idx = 0;
        for(int i=0;i<5;i++){
            if(sc.nextInt()==0)
                idx = i;
        }
        System.out.println(++idx);
    }

} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int idx = 0;
        for(int i=0;i<5;i++){
            if(sc.nextInt()==0)
                idx = i;
        }
        System.out.println(++idx);
    }

} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int idx = 0;
        for(int i=0;i<5;i++){
            if(sc.nextInt()==0)
                idx = i;
        }
        System.out.println(++idx);
    }

}
