import java.util.*;
public class Main {

    public static void main(String[] args) {
        Scanner  yomi = new Scanner(System.in);
        int n[] = new int[5];
        for (byte i=0; i<5; i++){
            n[i] = yomi.nextInt();
        }
        for (byte i=0; i<5; i++){
            if(n[i] == 0){
                System.out.println(i+1);
                break;
            }
        }
        }

} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner  yomi = new Scanner(System.in);
        int n[] = new int[5];
        for (byte i=0; i<5; i++){
            n[i] = yomi.nextInt();
        }
        for (byte i=0; i<5; i++){
            if(n[i] == 0){
                System.out.println(i+1);
                break;
            }
        }
        }

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

    public static void main(String[] args) {
        Scanner  yomi = new Scanner(System.in);
        int n[] = new int[5];
        for (byte i=0; i<5; i++){
            n[i] = yomi.nextInt();
        }
        for (byte i=0; i<5; i++){
            if(n[i] == 0){
                System.out.println(i+1);
                break;
            }
        }
        }

} public class Main {

    public static void main(String[] args) {
        Scanner  yomi = new Scanner(System.in);
        int n[] = new int[5];
        for (byte i=0; i<5; i++){
            n[i] = yomi.nextInt();
        }
        for (byte i=0; i<5; i++){
            if(n[i] == 0){
                System.out.println(i+1);
                break;
            }
        }
        }

} Main
import java.util.*;
public class Main {

    public static void main(String[] args) {
        Scanner  yomi = new Scanner(System.in);
        int n[] = new int[5];
        for (byte i=0; i<5; i++){
            n[i] = yomi.nextInt();
        }
        for (byte i=0; i<5; i++){
            if(n[i] == 0){
                System.out.println(i+1);
                break;
            }
        }
        }

}