import java.util.Scanner;
import java.lang.*;

public class Main{
 
	public static void main(String args[]){

      Scanner sc = new Scanner(System.in);
	int array[]  = new int[5];
	array[0] = sc.nextInt();
	array[1] = sc.nextInt();
	array[2] = sc.nextInt();
	array[3] = sc.nextInt();
	array[4] = sc.nextInt();



      for(int i = 0; i<5; i++){
      	if(array[i] == 0){
        	System.out.println(i+1);
        }
      
      
      }
      
      
      
    }      
} import java.util.Scanner; Scanner java.util import java.lang.*; lang.* java public class Main{
 
	public static void main(String args[]){

      Scanner sc = new Scanner(System.in);
	int array[]  = new int[5];
	array[0] = sc.nextInt();
	array[1] = sc.nextInt();
	array[2] = sc.nextInt();
	array[3] = sc.nextInt();
	array[4] = sc.nextInt();



      for(int i = 0; i<5; i++){
      	if(array[i] == 0){
        	System.out.println(i+1);
        }
      
      
      }
      
      
      
    }      
} Main public static void main(String args[]){

      Scanner sc = new Scanner(System.in);
	int array[]  = new int[5];
	array[0] = sc.nextInt();
	array[1] = sc.nextInt();
	array[2] = sc.nextInt();
	array[3] = sc.nextInt();
	array[4] = sc.nextInt();



      for(int i = 0; i<5; i++){
      	if(array[i] == 0){
        	System.out.println(i+1);
        }
      
      
      }
      
      
      
    } main {

      Scanner sc = new Scanner(System.in);
	int array[]  = new int[5];
	array[0] = sc.nextInt();
	array[1] = sc.nextInt();
	array[2] = sc.nextInt();
	array[3] = sc.nextInt();
	array[4] = sc.nextInt();



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

      Scanner sc = new Scanner(System.in);
	int array[]  = new int[5];
	array[0] = sc.nextInt();
	array[1] = sc.nextInt();
	array[2] = sc.nextInt();
	array[3] = sc.nextInt();
	array[4] = sc.nextInt();



      for(int i = 0; i<5; i++){
      	if(array[i] == 0){
        	System.out.println(i+1);
        }
      
      
      }
      
      
      
    }      
} public class Main{
 
	public static void main(String args[]){

      Scanner sc = new Scanner(System.in);
	int array[]  = new int[5];
	array[0] = sc.nextInt();
	array[1] = sc.nextInt();
	array[2] = sc.nextInt();
	array[3] = sc.nextInt();
	array[4] = sc.nextInt();



      for(int i = 0; i<5; i++){
      	if(array[i] == 0){
        	System.out.println(i+1);
        }
      
      
      }
      
      
      
    }      
} Main
import java.util.Scanner;
import java.lang.*;

public class Main{
 
	public static void main(String args[]){

      Scanner sc = new Scanner(System.in);
	int array[]  = new int[5];
	array[0] = sc.nextInt();
	array[1] = sc.nextInt();
	array[2] = sc.nextInt();
	array[3] = sc.nextInt();
	array[4] = sc.nextInt();



      for(int i = 0; i<5; i++){
      	if(array[i] == 0){
        	System.out.println(i+1);
        }
      
      
      }
      
      
      
    }      
}