import java.util.Scanner;
import java.util.Arrays;

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

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