import java.util.*;

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

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