import java.util.*;
class Main
{
  public static void main(String [] args)
  {
    Scanner s = new Scanner(System.in);
    int count = 0;
    int n = 9;
    while(n != 0)
    {
      n = s.nextInt();
      count++;
    } 
    System.out.println(count);
  }
} import java.util.*; util.* java class Main
{
  public static void main(String [] args)
  {
    Scanner s = new Scanner(System.in);
    int count = 0;
    int n = 9;
    while(n != 0)
    {
      n = s.nextInt();
      count++;
    } 
    System.out.println(count);
  }
} Main public static void main(String [] args)
  {
    Scanner s = new Scanner(System.in);
    int count = 0;
    int n = 9;
    while(n != 0)
    {
      n = s.nextInt();
      count++;
    } 
    System.out.println(count);
  } main {
    Scanner s = new Scanner(System.in);
    int count = 0;
    int n = 9;
    while(n != 0)
    {
      n = s.nextInt();
      count++;
    } 
    System.out.println(count);
  } Scanner s = new Scanner(System.in); s new Scanner(System.in) int count = 0; count 0 int n = 9; n 9 while(n != 0)
    {
      n = s.nextInt();
      count++;
    } n != 0 n 0 {
      n = s.nextInt();
      count++;
    } n = s.nextInt() n s.nextInt() s.nextInt s count++ count System.out.println(count) System.out.println System.out System System.out count String [] args args
import java.util.*;
class Main
{
  public static void main(String [] args)
  {
    Scanner s = new Scanner(System.in);
    int count = 0;
    int n = 9;
    while(n != 0)
    {
      n = s.nextInt();
      count++;
    } 
    System.out.println(count);
  }
}