import java.util.Scanner;
class Main{
  public static void main(String[] args){
	int ans = 0;
    Scanner scan = new Scanner(System.in);
    for(int i = 0;i < 5;i++){
      if(scan.nextInt() == 0)ans = i+1;
    }
    System.out.println(ans);
  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String[] args){
	int ans = 0;
    Scanner scan = new Scanner(System.in);
    for(int i = 0;i < 5;i++){
      if(scan.nextInt() == 0)ans = i+1;
    }
    System.out.println(ans);
  }
} Main public static void main(String[] args){
	int ans = 0;
    Scanner scan = new Scanner(System.in);
    for(int i = 0;i < 5;i++){
      if(scan.nextInt() == 0)ans = i+1;
    }
    System.out.println(ans);
  } main {
	int ans = 0;
    Scanner scan = new Scanner(System.in);
    for(int i = 0;i < 5;i++){
      if(scan.nextInt() == 0)ans = i+1;
    }
    System.out.println(ans);
  } int ans = 0; ans 0 Scanner scan = new Scanner(System.in); scan new Scanner(System.in) for(int i = 0;i < 5;i++){
      if(scan.nextInt() == 0)ans = i+1;
    } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
      if(scan.nextInt() == 0)ans = i+1;
    } {
      if(scan.nextInt() == 0)ans = i+1;
    } if(scan.nextInt() == 0)ans = i+1; scan.nextInt() == 0 scan.nextInt() scan.nextInt scan 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
import java.util.Scanner;
class Main{
  public static void main(String[] args){
	int ans = 0;
    Scanner scan = new Scanner(System.in);
    for(int i = 0;i < 5;i++){
      if(scan.nextInt() == 0)ans = i+1;
    }
    System.out.println(ans);
  }
}