/* package codechef; // don't place package name! */

import java.util.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main {
    public static void main (String[] args) {
        // your code goes here
        Scanner s = new Scanner(System.in);
        int j = 0;
        for(int i=0; i<5; i++)
        {
            int x = s.nextInt();
            if(x==0)
                j=i+1;
        }
        System.out.println(j);

    }
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
    public static void main (String[] args) {
        // your code goes here
        Scanner s = new Scanner(System.in);
        int j = 0;
        for(int i=0; i<5; i++)
        {
            int x = s.nextInt();
            if(x==0)
                j=i+1;
        }
        System.out.println(j);

    }
} Main public static void main (String[] args) {
        // your code goes here
        Scanner s = new Scanner(System.in);
        int j = 0;
        for(int i=0; i<5; i++)
        {
            int x = s.nextInt();
            if(x==0)
                j=i+1;
        }
        System.out.println(j);

    } main {
        // your code goes here
        Scanner s = new Scanner(System.in);
        int j = 0;
        for(int i=0; i<5; i++)
        {
            int x = s.nextInt();
            if(x==0)
                j=i+1;
        }
        System.out.println(j);

    } Scanner s = new Scanner(System.in); s new Scanner(System.in) int j = 0; j 0 for(int i=0; i<5; i++)
        {
            int x = s.nextInt();
            if(x==0)
                j=i+1;
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            int x = s.nextInt();
            if(x==0)
                j=i+1;
        } {
            int x = s.nextInt();
            if(x==0)
                j=i+1;
        } int x = s.nextInt(); x s.nextInt() s.nextInt s if(x==0)
                j=i+1; x==0 x 0 j=i+1 j i+1 i 1 System.out.println(j) System.out.println System.out System System.out j String[] args args public class Main {
    public static void main (String[] args) {
        // your code goes here
        Scanner s = new Scanner(System.in);
        int j = 0;
        for(int i=0; i<5; i++)
        {
            int x = s.nextInt();
            if(x==0)
                j=i+1;
        }
        System.out.println(j);

    }
} public class Main {
    public static void main (String[] args) {
        // your code goes here
        Scanner s = new Scanner(System.in);
        int j = 0;
        for(int i=0; i<5; i++)
        {
            int x = s.nextInt();
            if(x==0)
                j=i+1;
        }
        System.out.println(j);

    }
} Main
/* package codechef; // don't place package name! */

import java.util.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main {
    public static void main (String[] args) {
        // your code goes here
        Scanner s = new Scanner(System.in);
        int j = 0;
        for(int i=0; i<5; i++)
        {
            int x = s.nextInt();
            if(x==0)
                j=i+1;
        }
        System.out.println(j);

    }
}
