import java.util.Scanner;

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

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