import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	

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

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

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

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

public class Main {
	

	
	
	
	public static void main(String[] args) {
		
		Scanner s = new Scanner(System.in);
		int a[] = new int[5];
		int index = 0;
		for(int i=0;i<5;i++) {
			a[i] = s.nextInt();
			if(a[i]==0) {
				index = i+1;
			}
		}
		System.out.println(index);
	}
}