import java.util.*;

public class Main{
    public static void main(String[] args){

        Scanner scanner = new Scanner(System.in);

        for(int loop=0; loop<5; loop++) {
            int x = scanner.nextInt();
            if(x==0) {
                System.out.println( loop+1 );
                break;
            }
        }

    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){

        Scanner scanner = new Scanner(System.in);

        for(int loop=0; loop<5; loop++) {
            int x = scanner.nextInt();
            if(x==0) {
                System.out.println( loop+1 );
                break;
            }
        }

    }
} Main public static void main(String[] args){

        Scanner scanner = new Scanner(System.in);

        for(int loop=0; loop<5; loop++) {
            int x = scanner.nextInt();
            if(x==0) {
                System.out.println( loop+1 );
                break;
            }
        }

    } main {

        Scanner scanner = new Scanner(System.in);

        for(int loop=0; loop<5; loop++) {
            int x = scanner.nextInt();
            if(x==0) {
                System.out.println( loop+1 );
                break;
            }
        }

    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) for(int loop=0; loop<5; loop++) {
            int x = scanner.nextInt();
            if(x==0) {
                System.out.println( loop+1 );
                break;
            }
        } int loop=0; int loop=0; loop 0 loop<5 loop 5 loop++ loop++ loop {
            int x = scanner.nextInt();
            if(x==0) {
                System.out.println( loop+1 );
                break;
            }
        } {
            int x = scanner.nextInt();
            if(x==0) {
                System.out.println( loop+1 );
                break;
            }
        } int x = scanner.nextInt(); x scanner.nextInt() scanner.nextInt scanner if(x==0) {
                System.out.println( loop+1 );
                break;
            } x==0 x 0 {
                System.out.println( loop+1 );
                break;
            } System.out.println( loop+1 ) System.out.println System.out System System.out loop+1 loop 1 break; String[] args args public class Main{
    public static void main(String[] args){

        Scanner scanner = new Scanner(System.in);

        for(int loop=0; loop<5; loop++) {
            int x = scanner.nextInt();
            if(x==0) {
                System.out.println( loop+1 );
                break;
            }
        }

    }
} public class Main{
    public static void main(String[] args){

        Scanner scanner = new Scanner(System.in);

        for(int loop=0; loop<5; loop++) {
            int x = scanner.nextInt();
            if(x==0) {
                System.out.println( loop+1 );
                break;
            }
        }

    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args){

        Scanner scanner = new Scanner(System.in);

        for(int loop=0; loop<5; loop++) {
            int x = scanner.nextInt();
            if(x==0) {
                System.out.println( loop+1 );
                break;
            }
        }

    }
}