import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] strings = br.readLine().split(" ");
        int[] xs = new int[strings.length];
        for (int i = 0; i < xs.length; i++) {
            xs[i] = Integer.parseInt(strings[i]);
        }
        System.out.println(problem170a(xs));
    }

    private static int problem170a(int[] xs) {
        for (int i = 0; i < xs.length; i++) {
            if (xs[i] == 0) return (i + 1);
        }
        return 0;
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] strings = br.readLine().split(" ");
        int[] xs = new int[strings.length];
        for (int i = 0; i < xs.length; i++) {
            xs[i] = Integer.parseInt(strings[i]);
        }
        System.out.println(problem170a(xs));
    }

    private static int problem170a(int[] xs) {
        for (int i = 0; i < xs.length; i++) {
            if (xs[i] == 0) return (i + 1);
        }
        return 0;
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] strings = br.readLine().split(" ");
        int[] xs = new int[strings.length];
        for (int i = 0; i < xs.length; i++) {
            xs[i] = Integer.parseInt(strings[i]);
        }
        System.out.println(problem170a(xs));
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] strings = br.readLine().split(" ");
        int[] xs = new int[strings.length];
        for (int i = 0; i < xs.length; i++) {
            xs[i] = Integer.parseInt(strings[i]);
        }
        System.out.println(problem170a(xs));
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] strings = br.readLine().split(" "); strings br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[] xs = new int[strings.length]; xs new int[strings.length] strings.length strings strings.length for (int i = 0; i < xs.length; i++) {
            xs[i] = Integer.parseInt(strings[i]);
        } int i = 0; int i = 0; i 0 i < xs.length i xs.length xs xs.length i++ i++ i {
            xs[i] = Integer.parseInt(strings[i]);
        } {
            xs[i] = Integer.parseInt(strings[i]);
        } xs[i] = Integer.parseInt(strings[i]) xs[i] xs i Integer.parseInt(strings[i]) Integer.parseInt Integer strings[i] strings i System.out.println(problem170a(xs)) System.out.println System.out System System.out problem170a(xs) problem170a xs String[] args args private static int problem170a(int[] xs) {
        for (int i = 0; i < xs.length; i++) {
            if (xs[i] == 0) return (i + 1);
        }
        return 0;
    } problem170a {
        for (int i = 0; i < xs.length; i++) {
            if (xs[i] == 0) return (i + 1);
        }
        return 0;
    } for (int i = 0; i < xs.length; i++) {
            if (xs[i] == 0) return (i + 1);
        } int i = 0; int i = 0; i 0 i < xs.length i xs.length xs xs.length i++ i++ i {
            if (xs[i] == 0) return (i + 1);
        } {
            if (xs[i] == 0) return (i + 1);
        } if (xs[i] == 0) return (i + 1); xs[i] == 0 xs[i] xs i 0 return (i + 1); (i + 1) i 1 return 0; 0 int[] xs xs public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] strings = br.readLine().split(" ");
        int[] xs = new int[strings.length];
        for (int i = 0; i < xs.length; i++) {
            xs[i] = Integer.parseInt(strings[i]);
        }
        System.out.println(problem170a(xs));
    }

    private static int problem170a(int[] xs) {
        for (int i = 0; i < xs.length; i++) {
            if (xs[i] == 0) return (i + 1);
        }
        return 0;
    }
} public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] strings = br.readLine().split(" ");
        int[] xs = new int[strings.length];
        for (int i = 0; i < xs.length; i++) {
            xs[i] = Integer.parseInt(strings[i]);
        }
        System.out.println(problem170a(xs));
    }

    private static int problem170a(int[] xs) {
        for (int i = 0; i < xs.length; i++) {
            if (xs[i] == 0) return (i + 1);
        }
        return 0;
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] strings = br.readLine().split(" ");
        int[] xs = new int[strings.length];
        for (int i = 0; i < xs.length; i++) {
            xs[i] = Integer.parseInt(strings[i]);
        }
        System.out.println(problem170a(xs));
    }

    private static int problem170a(int[] xs) {
        for (int i = 0; i < xs.length; i++) {
            if (xs[i] == 0) return (i + 1);
        }
        return 0;
    }
}