import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try(Scanner scanner = new Scanner(System.in)) {
			String data = scanner.nextLine();

			String[] dataArray = data.split(" ");

			int index = 0;
			for (index = 0; index <= dataArray.length; index++) {
				if (dataArray[index].equals("0")) {
					break;
				}
			}

			System.out.println(index + 1);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		try(Scanner scanner = new Scanner(System.in)) {
			String data = scanner.nextLine();

			String[] dataArray = data.split(" ");

			int index = 0;
			for (index = 0; index <= dataArray.length; index++) {
				if (dataArray[index].equals("0")) {
					break;
				}
			}

			System.out.println(index + 1);
		}
	}
} Main public static void main(String[] args) {
		try(Scanner scanner = new Scanner(System.in)) {
			String data = scanner.nextLine();

			String[] dataArray = data.split(" ");

			int index = 0;
			for (index = 0; index <= dataArray.length; index++) {
				if (dataArray[index].equals("0")) {
					break;
				}
			}

			System.out.println(index + 1);
		}
	} main {
		try(Scanner scanner = new Scanner(System.in)) {
			String data = scanner.nextLine();

			String[] dataArray = data.split(" ");

			int index = 0;
			for (index = 0; index <= dataArray.length; index++) {
				if (dataArray[index].equals("0")) {
					break;
				}
			}

			System.out.println(index + 1);
		}
	} try(Scanner scanner = new Scanner(System.in)) {
			String data = scanner.nextLine();

			String[] dataArray = data.split(" ");

			int index = 0;
			for (index = 0; index <= dataArray.length; index++) {
				if (dataArray[index].equals("0")) {
					break;
				}
			}

			System.out.println(index + 1);
		} {
			String data = scanner.nextLine();

			String[] dataArray = data.split(" ");

			int index = 0;
			for (index = 0; index <= dataArray.length; index++) {
				if (dataArray[index].equals("0")) {
					break;
				}
			}

			System.out.println(index + 1);
		} Scanner scanner = new Scanner(System.in) Scanner scanner = new Scanner(System.in) new Scanner(System.in) String data = scanner.nextLine(); data scanner.nextLine() scanner.nextLine scanner String[] dataArray = data.split(" "); dataArray data.split(" ") data.split data " " int index = 0; index 0 for (index = 0; index <= dataArray.length; index++) {
				if (dataArray[index].equals("0")) {
					break;
				}
			} index = 0; index = 0 index 0 index <= dataArray.length index dataArray.length dataArray dataArray.length index++ index++ index {
				if (dataArray[index].equals("0")) {
					break;
				}
			} {
				if (dataArray[index].equals("0")) {
					break;
				}
			} if (dataArray[index].equals("0")) {
					break;
				} dataArray[index].equals("0") dataArray[index].equals dataArray[index] dataArray index "0" {
					break;
				} break; System.out.println(index + 1) System.out.println System.out System System.out index + 1 index 1 String[] args args public class Main {

	public static void main(String[] args) {
		try(Scanner scanner = new Scanner(System.in)) {
			String data = scanner.nextLine();

			String[] dataArray = data.split(" ");

			int index = 0;
			for (index = 0; index <= dataArray.length; index++) {
				if (dataArray[index].equals("0")) {
					break;
				}
			}

			System.out.println(index + 1);
		}
	}
} public class Main {

	public static void main(String[] args) {
		try(Scanner scanner = new Scanner(System.in)) {
			String data = scanner.nextLine();

			String[] dataArray = data.split(" ");

			int index = 0;
			for (index = 0; index <= dataArray.length; index++) {
				if (dataArray[index].equals("0")) {
					break;
				}
			}

			System.out.println(index + 1);
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try(Scanner scanner = new Scanner(System.in)) {
			String data = scanner.nextLine();

			String[] dataArray = data.split(" ");

			int index = 0;
			for (index = 0; index <= dataArray.length; index++) {
				if (dataArray[index].equals("0")) {
					break;
				}
			}

			System.out.println(index + 1);
		}
	}
}