import java.util.Scanner;
 
public class Main {
  public static void main(String[] args ) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int i =1;
    if (N==0) {
      System.out.println(i);
    } else {
      i = i + 1;
      N = sc.nextInt();
      if (N==0) {
        System.out.println(i);
   	  } else {
        i = i + 1;
        N = sc.nextInt();
        if (N==0) {
     	 System.out.println(i);
   		 } else {
     		 i = i + 1;
     		 N = sc.nextInt();
          	if (N==0) {
      			System.out.println(i);
   			 } else {
     			 i = i + 1;
     			 System.out.println(i);
   			 }
          }
      }
  }
}
}

 import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args ) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int i =1;
    if (N==0) {
      System.out.println(i);
    } else {
      i = i + 1;
      N = sc.nextInt();
      if (N==0) {
        System.out.println(i);
   	  } else {
        i = i + 1;
        N = sc.nextInt();
        if (N==0) {
     	 System.out.println(i);
   		 } else {
     		 i = i + 1;
     		 N = sc.nextInt();
          	if (N==0) {
      			System.out.println(i);
   			 } else {
     			 i = i + 1;
     			 System.out.println(i);
   			 }
          }
      }
  }
}
} Main public static void main(String[] args ) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int i =1;
    if (N==0) {
      System.out.println(i);
    } else {
      i = i + 1;
      N = sc.nextInt();
      if (N==0) {
        System.out.println(i);
   	  } else {
        i = i + 1;
        N = sc.nextInt();
        if (N==0) {
     	 System.out.println(i);
   		 } else {
     		 i = i + 1;
     		 N = sc.nextInt();
          	if (N==0) {
      			System.out.println(i);
   			 } else {
     			 i = i + 1;
     			 System.out.println(i);
   			 }
          }
      }
  }
} main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int i =1;
    if (N==0) {
      System.out.println(i);
    } else {
      i = i + 1;
      N = sc.nextInt();
      if (N==0) {
        System.out.println(i);
   	  } else {
        i = i + 1;
        N = sc.nextInt();
        if (N==0) {
     	 System.out.println(i);
   		 } else {
     		 i = i + 1;
     		 N = sc.nextInt();
          	if (N==0) {
      			System.out.println(i);
   			 } else {
     			 i = i + 1;
     			 System.out.println(i);
   			 }
          }
      }
  }
} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int i =1; i 1 if (N==0) {
      System.out.println(i);
    } else {
      i = i + 1;
      N = sc.nextInt();
      if (N==0) {
        System.out.println(i);
   	  } else {
        i = i + 1;
        N = sc.nextInt();
        if (N==0) {
     	 System.out.println(i);
   		 } else {
     		 i = i + 1;
     		 N = sc.nextInt();
          	if (N==0) {
      			System.out.println(i);
   			 } else {
     			 i = i + 1;
     			 System.out.println(i);
   			 }
          }
      }
  } N==0 N 0 {
      System.out.println(i);
    } System.out.println(i) System.out.println System.out System System.out i {
      i = i + 1;
      N = sc.nextInt();
      if (N==0) {
        System.out.println(i);
   	  } else {
        i = i + 1;
        N = sc.nextInt();
        if (N==0) {
     	 System.out.println(i);
   		 } else {
     		 i = i + 1;
     		 N = sc.nextInt();
          	if (N==0) {
      			System.out.println(i);
   			 } else {
     			 i = i + 1;
     			 System.out.println(i);
   			 }
          }
      }
  } i = i + 1 i i + 1 i 1 N = sc.nextInt() N sc.nextInt() sc.nextInt sc if (N==0) {
        System.out.println(i);
   	  } else {
        i = i + 1;
        N = sc.nextInt();
        if (N==0) {
     	 System.out.println(i);
   		 } else {
     		 i = i + 1;
     		 N = sc.nextInt();
          	if (N==0) {
      			System.out.println(i);
   			 } else {
     			 i = i + 1;
     			 System.out.println(i);
   			 }
          }
      } N==0 N 0 {
        System.out.println(i);
   	  } System.out.println(i) System.out.println System.out System System.out i {
        i = i + 1;
        N = sc.nextInt();
        if (N==0) {
     	 System.out.println(i);
   		 } else {
     		 i = i + 1;
     		 N = sc.nextInt();
          	if (N==0) {
      			System.out.println(i);
   			 } else {
     			 i = i + 1;
     			 System.out.println(i);
   			 }
          }
      } i = i + 1 i i + 1 i 1 N = sc.nextInt() N sc.nextInt() sc.nextInt sc if (N==0) {
     	 System.out.println(i);
   		 } else {
     		 i = i + 1;
     		 N = sc.nextInt();
          	if (N==0) {
      			System.out.println(i);
   			 } else {
     			 i = i + 1;
     			 System.out.println(i);
   			 }
          } N==0 N 0 {
     	 System.out.println(i);
   		 } System.out.println(i) System.out.println System.out System System.out i {
     		 i = i + 1;
     		 N = sc.nextInt();
          	if (N==0) {
      			System.out.println(i);
   			 } else {
     			 i = i + 1;
     			 System.out.println(i);
   			 }
          } i = i + 1 i i + 1 i 1 N = sc.nextInt() N sc.nextInt() sc.nextInt sc if (N==0) {
      			System.out.println(i);
   			 } else {
     			 i = i + 1;
     			 System.out.println(i);
   			 } N==0 N 0 {
      			System.out.println(i);
   			 } System.out.println(i) System.out.println System.out System System.out i {
     			 i = i + 1;
     			 System.out.println(i);
   			 } i = i + 1 i i + 1 i 1 System.out.println(i) System.out.println System.out System System.out i String[] args args public class Main {
  public static void main(String[] args ) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int i =1;
    if (N==0) {
      System.out.println(i);
    } else {
      i = i + 1;
      N = sc.nextInt();
      if (N==0) {
        System.out.println(i);
   	  } else {
        i = i + 1;
        N = sc.nextInt();
        if (N==0) {
     	 System.out.println(i);
   		 } else {
     		 i = i + 1;
     		 N = sc.nextInt();
          	if (N==0) {
      			System.out.println(i);
   			 } else {
     			 i = i + 1;
     			 System.out.println(i);
   			 }
          }
      }
  }
}
} public class Main {
  public static void main(String[] args ) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int i =1;
    if (N==0) {
      System.out.println(i);
    } else {
      i = i + 1;
      N = sc.nextInt();
      if (N==0) {
        System.out.println(i);
   	  } else {
        i = i + 1;
        N = sc.nextInt();
        if (N==0) {
     	 System.out.println(i);
   		 } else {
     		 i = i + 1;
     		 N = sc.nextInt();
          	if (N==0) {
      			System.out.println(i);
   			 } else {
     			 i = i + 1;
     			 System.out.println(i);
   			 }
          }
      }
  }
}
} Main
import java.util.Scanner;
 
public class Main {
  public static void main(String[] args ) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int i =1;
    if (N==0) {
      System.out.println(i);
    } else {
      i = i + 1;
      N = sc.nextInt();
      if (N==0) {
        System.out.println(i);
   	  } else {
        i = i + 1;
        N = sc.nextInt();
        if (N==0) {
     	 System.out.println(i);
   		 } else {
     		 i = i + 1;
     		 N = sc.nextInt();
          	if (N==0) {
      			System.out.println(i);
   			 } else {
     			 i = i + 1;
     			 System.out.println(i);
   			 }
          }
      }
  }
}
}


