import java.util.*;

class Main
{
    public static void main(String[] args)
    {
        int x=-1, k=-1;
        Scanner input = new Scanner(System.in);
        for(int i=1; i<=5; i++){
            x=input.nextInt();
            if(x==0){
                k=i;
            }
        }
        System.out.print(k);
    }
} import java.util.*; util.* java class Main
{
    public static void main(String[] args)
    {
        int x=-1, k=-1;
        Scanner input = new Scanner(System.in);
        for(int i=1; i<=5; i++){
            x=input.nextInt();
            if(x==0){
                k=i;
            }
        }
        System.out.print(k);
    }
} Main public static void main(String[] args)
    {
        int x=-1, k=-1;
        Scanner input = new Scanner(System.in);
        for(int i=1; i<=5; i++){
            x=input.nextInt();
            if(x==0){
                k=i;
            }
        }
        System.out.print(k);
    } main {
        int x=-1, k=-1;
        Scanner input = new Scanner(System.in);
        for(int i=1; i<=5; i++){
            x=input.nextInt();
            if(x==0){
                k=i;
            }
        }
        System.out.print(k);
    } int x=-1 x -1 1 k=-1; k -1 1 Scanner input = new Scanner(System.in); input new Scanner(System.in) for(int i=1; i<=5; i++){
            x=input.nextInt();
            if(x==0){
                k=i;
            }
        } int i=1; int i=1; i 1 i<=5 i 5 i++ i++ i {
            x=input.nextInt();
            if(x==0){
                k=i;
            }
        } {
            x=input.nextInt();
            if(x==0){
                k=i;
            }
        } x=input.nextInt() x input.nextInt() input.nextInt input if(x==0){
                k=i;
            } x==0 x 0 {
                k=i;
            } k=i k i System.out.print(k) System.out.print System.out System System.out k String[] args args
import java.util.*;

class Main
{
    public static void main(String[] args)
    {
        int x=-1, k=-1;
        Scanner input = new Scanner(System.in);
        for(int i=1; i<=5; i++){
            x=input.nextInt();
            if(x==0){
                k=i;
            }
        }
        System.out.print(k);
    }
}