
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

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

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

        for (int i = 1 ; i <= 5 ; i++) {
            int x = scanner.nextInt();
            if (x == 0) {
                System.out.println(i);
                return;
            }
        }
    } main {
        Scanner scanner = new Scanner(System.in);

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

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

        for (int i = 1 ; i <= 5 ; i++) {
            int x = scanner.nextInt();
            if (x == 0) {
                System.out.println(i);
                return;
            }
        }
    }
} Main

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        for (int i = 1 ; i <= 5 ; i++) {
            int x = scanner.nextInt();
            if (x == 0) {
                System.out.println(i);
                return;
            }
        }
    }
}
