import java.util.*;

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

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

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

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

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

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

        for (int i=0; i<nums.length; i++){
            nums[i] = sc.nextInt();
            if(nums[i]==0){
                System.out.print(i+1);
                return;
            }
        }
    }
} Main
import java.util.*;

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

        for (int i=0; i<nums.length; i++){
            nums[i] = sc.nextInt();
            if(nums[i]==0){
                System.out.print(i+1);
                return;
            }
        }
    }
}