import java.util.Scanner;

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

        int iResult = 0;
        for (int i = 1; i <= 5; i++) {
            if (0 == Integer.parseInt(sc.next())) {
                iResult = i;
            }
        }
        System.out.print(iResult);

    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);

        int iResult = 0;
        for (int i = 1; i <= 5; i++) {
            if (0 == Integer.parseInt(sc.next())) {
                iResult = i;
            }
        }
        System.out.print(iResult);

    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);

        int iResult = 0;
        for (int i = 1; i <= 5; i++) {
            if (0 == Integer.parseInt(sc.next())) {
                iResult = i;
            }
        }
        System.out.print(iResult);

    } main {
        Scanner sc = new Scanner(System.in);

        int iResult = 0;
        for (int i = 1; i <= 5; i++) {
            if (0 == Integer.parseInt(sc.next())) {
                iResult = i;
            }
        }
        System.out.print(iResult);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int iResult = 0; iResult 0 for (int i = 1; i <= 5; i++) {
            if (0 == Integer.parseInt(sc.next())) {
                iResult = i;
            }
        } int i = 1; int i = 1; i 1 i <= 5 i 5 i++ i++ i {
            if (0 == Integer.parseInt(sc.next())) {
                iResult = i;
            }
        } {
            if (0 == Integer.parseInt(sc.next())) {
                iResult = i;
            }
        } if (0 == Integer.parseInt(sc.next())) {
                iResult = i;
            } 0 == Integer.parseInt(sc.next()) 0 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc {
                iResult = i;
            } iResult = i iResult i System.out.print(iResult) System.out.print System.out System System.out iResult String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);

        int iResult = 0;
        for (int i = 1; i <= 5; i++) {
            if (0 == Integer.parseInt(sc.next())) {
                iResult = i;
            }
        }
        System.out.print(iResult);

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

        int iResult = 0;
        for (int i = 1; i <= 5; i++) {
            if (0 == Integer.parseInt(sc.next())) {
                iResult = i;
            }
        }
        System.out.print(iResult);

    }
} Main
import java.util.Scanner;

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

        int iResult = 0;
        for (int i = 1; i <= 5; i++) {
            if (0 == Integer.parseInt(sc.next())) {
                iResult = i;
            }
        }
        System.out.print(iResult);

    }
}
