import java.util.*;

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

    System.out.println(ans);
    scan.close();

}

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

    System.out.println(ans);
    scan.close();

}

} Main public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int[] x = new int[5];
    int ans = 0;
    for(int i=0;i<5;i++) {
        x[i] = scan.nextInt();
        if(x[i] == 0) {
            ans = i + 1;
        }
    } 

    System.out.println(ans);
    scan.close();

} main {
    Scanner scan = new Scanner(System.in);
    int[] x = new int[5];
    int ans = 0;
    for(int i=0;i<5;i++) {
        x[i] = scan.nextInt();
        if(x[i] == 0) {
            ans = i + 1;
        }
    } 

    System.out.println(ans);
    scan.close();

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

    System.out.println(ans);
    scan.close();

}

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

    System.out.println(ans);
    scan.close();

}

} Main
import java.util.*;

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

    System.out.println(ans);
    scan.close();

}

};
