import java.util.Scanner;
public class Main{
 public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
   int a[] = new int[5];
    a[0] = stdIn.nextInt();
    a[1] = stdIn.nextInt();
    a[2] = stdIn.nextInt();
    a[3] = stdIn.nextInt();
    a[4] = stdIn.nextInt();
     if (a[0] == 0) {
       System.out.println("1");
     }
     if (a[1] == 0) {
       System.out.println("2");
     }
     if (a[2] == 0) {
       System.out.println("3");
     }
     if (a[3] == 0) {
       System.out.println("4");
     }
     if (a[4] == 0) {
      System.out.println("5");
     }
 }
} import java.util.Scanner; Scanner java.util public class Main{
 public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
   int a[] = new int[5];
    a[0] = stdIn.nextInt();
    a[1] = stdIn.nextInt();
    a[2] = stdIn.nextInt();
    a[3] = stdIn.nextInt();
    a[4] = stdIn.nextInt();
     if (a[0] == 0) {
       System.out.println("1");
     }
     if (a[1] == 0) {
       System.out.println("2");
     }
     if (a[2] == 0) {
       System.out.println("3");
     }
     if (a[3] == 0) {
       System.out.println("4");
     }
     if (a[4] == 0) {
      System.out.println("5");
     }
 }
} Main public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
   int a[] = new int[5];
    a[0] = stdIn.nextInt();
    a[1] = stdIn.nextInt();
    a[2] = stdIn.nextInt();
    a[3] = stdIn.nextInt();
    a[4] = stdIn.nextInt();
     if (a[0] == 0) {
       System.out.println("1");
     }
     if (a[1] == 0) {
       System.out.println("2");
     }
     if (a[2] == 0) {
       System.out.println("3");
     }
     if (a[3] == 0) {
       System.out.println("4");
     }
     if (a[4] == 0) {
      System.out.println("5");
     }
 } main {
	Scanner stdIn = new Scanner(System.in);
   int a[] = new int[5];
    a[0] = stdIn.nextInt();
    a[1] = stdIn.nextInt();
    a[2] = stdIn.nextInt();
    a[3] = stdIn.nextInt();
    a[4] = stdIn.nextInt();
     if (a[0] == 0) {
       System.out.println("1");
     }
     if (a[1] == 0) {
       System.out.println("2");
     }
     if (a[2] == 0) {
       System.out.println("3");
     }
     if (a[3] == 0) {
       System.out.println("4");
     }
     if (a[4] == 0) {
      System.out.println("5");
     }
 } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int a[] = new int[5]; a new int[5] 5 a[0] = stdIn.nextInt() a[0] a 0 stdIn.nextInt() stdIn.nextInt stdIn a[1] = stdIn.nextInt() a[1] a 1 stdIn.nextInt() stdIn.nextInt stdIn a[2] = stdIn.nextInt() a[2] a 2 stdIn.nextInt() stdIn.nextInt stdIn a[3] = stdIn.nextInt() a[3] a 3 stdIn.nextInt() stdIn.nextInt stdIn a[4] = stdIn.nextInt() a[4] a 4 stdIn.nextInt() stdIn.nextInt stdIn if (a[0] == 0) {
       System.out.println("1");
     } a[0] == 0 a[0] a 0 0 {
       System.out.println("1");
     } System.out.println("1") System.out.println System.out System System.out "1" if (a[1] == 0) {
       System.out.println("2");
     } a[1] == 0 a[1] a 1 0 {
       System.out.println("2");
     } System.out.println("2") System.out.println System.out System System.out "2" if (a[2] == 0) {
       System.out.println("3");
     } a[2] == 0 a[2] a 2 0 {
       System.out.println("3");
     } System.out.println("3") System.out.println System.out System System.out "3" if (a[3] == 0) {
       System.out.println("4");
     } a[3] == 0 a[3] a 3 0 {
       System.out.println("4");
     } System.out.println("4") System.out.println System.out System System.out "4" if (a[4] == 0) {
      System.out.println("5");
     } a[4] == 0 a[4] a 4 0 {
      System.out.println("5");
     } System.out.println("5") System.out.println System.out System System.out "5" String[] args args public class Main{
 public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
   int a[] = new int[5];
    a[0] = stdIn.nextInt();
    a[1] = stdIn.nextInt();
    a[2] = stdIn.nextInt();
    a[3] = stdIn.nextInt();
    a[4] = stdIn.nextInt();
     if (a[0] == 0) {
       System.out.println("1");
     }
     if (a[1] == 0) {
       System.out.println("2");
     }
     if (a[2] == 0) {
       System.out.println("3");
     }
     if (a[3] == 0) {
       System.out.println("4");
     }
     if (a[4] == 0) {
      System.out.println("5");
     }
 }
} public class Main{
 public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
   int a[] = new int[5];
    a[0] = stdIn.nextInt();
    a[1] = stdIn.nextInt();
    a[2] = stdIn.nextInt();
    a[3] = stdIn.nextInt();
    a[4] = stdIn.nextInt();
     if (a[0] == 0) {
       System.out.println("1");
     }
     if (a[1] == 0) {
       System.out.println("2");
     }
     if (a[2] == 0) {
       System.out.println("3");
     }
     if (a[3] == 0) {
       System.out.println("4");
     }
     if (a[4] == 0) {
      System.out.println("5");
     }
 }
} Main
import java.util.Scanner;
public class Main{
 public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
   int a[] = new int[5];
    a[0] = stdIn.nextInt();
    a[1] = stdIn.nextInt();
    a[2] = stdIn.nextInt();
    a[3] = stdIn.nextInt();
    a[4] = stdIn.nextInt();
     if (a[0] == 0) {
       System.out.println("1");
     }
     if (a[1] == 0) {
       System.out.println("2");
     }
     if (a[2] == 0) {
       System.out.println("3");
     }
     if (a[3] == 0) {
       System.out.println("4");
     }
     if (a[4] == 0) {
      System.out.println("5");
     }
 }
}