import java.util.*;
import java.lang.*;
import java.io.*;										

public class Main{
	public static void main(String args[]){
		InputStreamReader rd = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(rd);
		try{
				ArrayList<Integer> al = new ArrayList<Integer>();
				String str = br.readLine();
				String initial[] = str.split(" ");
				for(int j=0;j<initial.length;j++){
					al.add(Integer.parseInt(initial[j]));
				}
				int pos = al.indexOf(0);
				System.out.println(pos+1);
		}
		catch(Exception e){
			return;
		}
	}
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public class Main{
	public static void main(String args[]){
		InputStreamReader rd = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(rd);
		try{
				ArrayList<Integer> al = new ArrayList<Integer>();
				String str = br.readLine();
				String initial[] = str.split(" ");
				for(int j=0;j<initial.length;j++){
					al.add(Integer.parseInt(initial[j]));
				}
				int pos = al.indexOf(0);
				System.out.println(pos+1);
		}
		catch(Exception e){
			return;
		}
	}
} Main public static void main(String args[]){
		InputStreamReader rd = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(rd);
		try{
				ArrayList<Integer> al = new ArrayList<Integer>();
				String str = br.readLine();
				String initial[] = str.split(" ");
				for(int j=0;j<initial.length;j++){
					al.add(Integer.parseInt(initial[j]));
				}
				int pos = al.indexOf(0);
				System.out.println(pos+1);
		}
		catch(Exception e){
			return;
		}
	} main {
		InputStreamReader rd = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(rd);
		try{
				ArrayList<Integer> al = new ArrayList<Integer>();
				String str = br.readLine();
				String initial[] = str.split(" ");
				for(int j=0;j<initial.length;j++){
					al.add(Integer.parseInt(initial[j]));
				}
				int pos = al.indexOf(0);
				System.out.println(pos+1);
		}
		catch(Exception e){
			return;
		}
	} InputStreamReader rd = new InputStreamReader(System.in); rd new InputStreamReader(System.in) BufferedReader br = new BufferedReader(rd); br new BufferedReader(rd) try{
				ArrayList<Integer> al = new ArrayList<Integer>();
				String str = br.readLine();
				String initial[] = str.split(" ");
				for(int j=0;j<initial.length;j++){
					al.add(Integer.parseInt(initial[j]));
				}
				int pos = al.indexOf(0);
				System.out.println(pos+1);
		}
		catch(Exception e){
			return;
		} catch(Exception e){
			return;
		} Exception e {
			return;
		} return; {
				ArrayList<Integer> al = new ArrayList<Integer>();
				String str = br.readLine();
				String initial[] = str.split(" ");
				for(int j=0;j<initial.length;j++){
					al.add(Integer.parseInt(initial[j]));
				}
				int pos = al.indexOf(0);
				System.out.println(pos+1);
		} ArrayList<Integer> al = new ArrayList<Integer>(); al new ArrayList<Integer>() String str = br.readLine(); str br.readLine() br.readLine br String initial[] = str.split(" "); initial str.split(" ") str.split str " " for(int j=0;j<initial.length;j++){
					al.add(Integer.parseInt(initial[j]));
				} int j=0; int j=0; j 0 j<initial.length j initial.length initial initial.length j++ j++ j {
					al.add(Integer.parseInt(initial[j]));
				} {
					al.add(Integer.parseInt(initial[j]));
				} al.add(Integer.parseInt(initial[j])) al.add al Integer.parseInt(initial[j]) Integer.parseInt Integer initial[j] initial j int pos = al.indexOf(0); pos al.indexOf(0) al.indexOf al 0 System.out.println(pos+1) System.out.println System.out System System.out pos+1 pos 1 String args[] args public class Main{
	public static void main(String args[]){
		InputStreamReader rd = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(rd);
		try{
				ArrayList<Integer> al = new ArrayList<Integer>();
				String str = br.readLine();
				String initial[] = str.split(" ");
				for(int j=0;j<initial.length;j++){
					al.add(Integer.parseInt(initial[j]));
				}
				int pos = al.indexOf(0);
				System.out.println(pos+1);
		}
		catch(Exception e){
			return;
		}
	}
} public class Main{
	public static void main(String args[]){
		InputStreamReader rd = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(rd);
		try{
				ArrayList<Integer> al = new ArrayList<Integer>();
				String str = br.readLine();
				String initial[] = str.split(" ");
				for(int j=0;j<initial.length;j++){
					al.add(Integer.parseInt(initial[j]));
				}
				int pos = al.indexOf(0);
				System.out.println(pos+1);
		}
		catch(Exception e){
			return;
		}
	}
} Main
import java.util.*;
import java.lang.*;
import java.io.*;										

public class Main{
	public static void main(String args[]){
		InputStreamReader rd = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(rd);
		try{
				ArrayList<Integer> al = new ArrayList<Integer>();
				String str = br.readLine();
				String initial[] = str.split(" ");
				for(int j=0;j<initial.length;j++){
					al.add(Integer.parseInt(initial[j]));
				}
				int pos = al.indexOf(0);
				System.out.println(pos+1);
		}
		catch(Exception e){
			return;
		}
	}
}