import java.util.*;

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

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