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