import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.BigDecimal;

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

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