import java.util.Scanner;

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

        if (X[0] == 0) {
            System.out.println("1");
        }
        if (X[1] == 0) {
            System.out.println("2");
        }

        if (X[2] == 0) {
            System.out.println("3");
        }

        if (X[3] == 0) {
            System.out.println("4");
        }

        if (X[4] == 0) {
            System.out.println("5");
        }

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

        if (X[0] == 0) {
            System.out.println("1");
        }
        if (X[1] == 0) {
            System.out.println("2");
        }

        if (X[2] == 0) {
            System.out.println("3");
        }

        if (X[3] == 0) {
            System.out.println("4");
        }

        if (X[4] == 0) {
            System.out.println("5");
        }

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

        if (X[0] == 0) {
            System.out.println("1");
        }
        if (X[1] == 0) {
            System.out.println("2");
        }

        if (X[2] == 0) {
            System.out.println("3");
        }

        if (X[3] == 0) {
            System.out.println("4");
        }

        if (X[4] == 0) {
            System.out.println("5");
        }

    } main {
        Scanner sc = new Scanner(System.in);
        int[] X = new int[5];
        for (int i = 0; i < 5; i++) {
            X[i] = sc.nextInt();
        }

        if (X[0] == 0) {
            System.out.println("1");
        }
        if (X[1] == 0) {
            System.out.println("2");
        }

        if (X[2] == 0) {
            System.out.println("3");
        }

        if (X[3] == 0) {
            System.out.println("4");
        }

        if (X[4] == 0) {
            System.out.println("5");
        }

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

        if (X[0] == 0) {
            System.out.println("1");
        }
        if (X[1] == 0) {
            System.out.println("2");
        }

        if (X[2] == 0) {
            System.out.println("3");
        }

        if (X[3] == 0) {
            System.out.println("4");
        }

        if (X[4] == 0) {
            System.out.println("5");
        }

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

        if (X[0] == 0) {
            System.out.println("1");
        }
        if (X[1] == 0) {
            System.out.println("2");
        }

        if (X[2] == 0) {
            System.out.println("3");
        }

        if (X[3] == 0) {
            System.out.println("4");
        }

        if (X[4] == 0) {
            System.out.println("5");
        }

    }
} Main
import java.util.Scanner;

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

        if (X[0] == 0) {
            System.out.println("1");
        }
        if (X[1] == 0) {
            System.out.println("2");
        }

        if (X[2] == 0) {
            System.out.println("3");
        }

        if (X[3] == 0) {
            System.out.println("4");
        }

        if (X[4] == 0) {
            System.out.println("5");
        }

    }
}