import java.util.LinkedList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		LinkedList<String> list = new LinkedList<String>();

		while (sc.hasNext()) {
			list.add(sc.next());
		}

		sc.close();

		int ans = 0;

		for (int i = 0; i < list.size(); i++) {
			if (list.get(i).equals("0")) {
				ans = i + 1;
			}
		}

		System.out.println(ans);

	}

} import java.util.LinkedList; LinkedList java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		LinkedList<String> list = new LinkedList<String>();

		while (sc.hasNext()) {
			list.add(sc.next());
		}

		sc.close();

		int ans = 0;

		for (int i = 0; i < list.size(); i++) {
			if (list.get(i).equals("0")) {
				ans = i + 1;
			}
		}

		System.out.println(ans);

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		LinkedList<String> list = new LinkedList<String>();

		while (sc.hasNext()) {
			list.add(sc.next());
		}

		sc.close();

		int ans = 0;

		for (int i = 0; i < list.size(); i++) {
			if (list.get(i).equals("0")) {
				ans = i + 1;
			}
		}

		System.out.println(ans);

	} main {
		Scanner sc = new Scanner(System.in);

		LinkedList<String> list = new LinkedList<String>();

		while (sc.hasNext()) {
			list.add(sc.next());
		}

		sc.close();

		int ans = 0;

		for (int i = 0; i < list.size(); i++) {
			if (list.get(i).equals("0")) {
				ans = i + 1;
			}
		}

		System.out.println(ans);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) LinkedList<String> list = new LinkedList<String>(); list new LinkedList<String>() while (sc.hasNext()) {
			list.add(sc.next());
		} sc.hasNext() sc.hasNext sc {
			list.add(sc.next());
		} list.add(sc.next()) list.add list sc.next() sc.next sc sc.close() sc.close sc int ans = 0; ans 0 for (int i = 0; i < list.size(); i++) {
			if (list.get(i).equals("0")) {
				ans = i + 1;
			}
		} int i = 0; int i = 0; i 0 i < list.size() i list.size() list.size list i++ i++ i {
			if (list.get(i).equals("0")) {
				ans = i + 1;
			}
		} {
			if (list.get(i).equals("0")) {
				ans = i + 1;
			}
		} if (list.get(i).equals("0")) {
				ans = i + 1;
			} list.get(i).equals("0") list.get(i).equals list.get(i) list.get list i "0" {
				ans = i + 1;
			} ans = i + 1 ans i + 1 i 1 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		LinkedList<String> list = new LinkedList<String>();

		while (sc.hasNext()) {
			list.add(sc.next());
		}

		sc.close();

		int ans = 0;

		for (int i = 0; i < list.size(); i++) {
			if (list.get(i).equals("0")) {
				ans = i + 1;
			}
		}

		System.out.println(ans);

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		LinkedList<String> list = new LinkedList<String>();

		while (sc.hasNext()) {
			list.add(sc.next());
		}

		sc.close();

		int ans = 0;

		for (int i = 0; i < list.size(); i++) {
			if (list.get(i).equals("0")) {
				ans = i + 1;
			}
		}

		System.out.println(ans);

	}

} Main
import java.util.LinkedList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		LinkedList<String> list = new LinkedList<String>();

		while (sc.hasNext()) {
			list.add(sc.next());
		}

		sc.close();

		int ans = 0;

		for (int i = 0; i < list.size(); i++) {
			if (list.get(i).equals("0")) {
				ans = i + 1;
			}
		}

		System.out.println(ans);

	}

}