/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Pollock
 */
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int a[] = new int[5];
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
        }
        int idx = 0;
        for (int i = 0; i < a.length; i++) {
            if (a[i] == 0) {
                idx = i;
            }
        }
            System.out.println(idx + 1);
        }
    }
 import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {

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

        Scanner sc = new Scanner(System.in);
        int a[] = new int[5];
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
        }
        int idx = 0;
        for (int i = 0; i < a.length; i++) {
            if (a[i] == 0) {
                idx = i;
            }
        }
            System.out.println(idx + 1);
        } main {

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

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int a[] = new int[5];
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
        }
        int idx = 0;
        for (int i = 0; i < a.length; i++) {
            if (a[i] == 0) {
                idx = i;
            }
        }
            System.out.println(idx + 1);
        }
    } public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int a[] = new int[5];
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
        }
        int idx = 0;
        for (int i = 0; i < a.length; i++) {
            if (a[i] == 0) {
                idx = i;
            }
        }
            System.out.println(idx + 1);
        }
    } Main
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Pollock
 */
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int a[] = new int[5];
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
        }
        int idx = 0;
        for (int i = 0; i < a.length; i++) {
            if (a[i] == 0) {
                idx = i;
            }
        }
            System.out.println(idx + 1);
        }
    }

