import java.util.*;

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

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