import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String s = br.readLine().replace(" ", "");

		System.out.println(s.indexOf("0") + 1);
	}
} import java.io.*; io.* java public class Main {

	public static void main(String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String s = br.readLine().replace(" ", "");

		System.out.println(s.indexOf("0") + 1);
	}
} Main public static void main(String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String s = br.readLine().replace(" ", "");

		System.out.println(s.indexOf("0") + 1);
	} main {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String s = br.readLine().replace(" ", "");

		System.out.println(s.indexOf("0") + 1);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String s = br.readLine().replace(" ", ""); s br.readLine().replace(" ", "") br.readLine().replace br.readLine() br.readLine br " " "" System.out.println(s.indexOf("0") + 1) System.out.println System.out System System.out s.indexOf("0") + 1 s.indexOf("0") s.indexOf s "0" 1 String[] args args public class Main {

	public static void main(String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String s = br.readLine().replace(" ", "");

		System.out.println(s.indexOf("0") + 1);
	}
} public class Main {

	public static void main(String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String s = br.readLine().replace(" ", "");

		System.out.println(s.indexOf("0") + 1);
	}
} Main
import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String s = br.readLine().replace(" ", "");

		System.out.println(s.indexOf("0") + 1);
	}
}