import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] xs = new int[5];
        int ans = 0;
        for(int i=0; i<xs.length; i++) {
            xs[i] = scanner.nextInt();
            if(xs[i] == 0) {
                ans = i+1;
            }
        }
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] xs = new int[5];
        int ans = 0;
        for(int i=0; i<xs.length; i++) {
            xs[i] = scanner.nextInt();
            if(xs[i] == 0) {
                ans = i+1;
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] xs = new int[5];
        int ans = 0;
        for(int i=0; i<xs.length; i++) {
            xs[i] = scanner.nextInt();
            if(xs[i] == 0) {
                ans = i+1;
            }
        }
        System.out.println(ans);
    } main {
        Scanner scanner = new Scanner(System.in);
        int[] xs = new int[5];
        int ans = 0;
        for(int i=0; i<xs.length; i++) {
            xs[i] = scanner.nextInt();
            if(xs[i] == 0) {
                ans = i+1;
            }
        }
        System.out.println(ans);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int[] xs = new int[5]; xs new int[5] 5 int ans = 0; ans 0 for(int i=0; i<xs.length; i++) {
            xs[i] = scanner.nextInt();
            if(xs[i] == 0) {
                ans = i+1;
            }
        } int i=0; int i=0; i 0 i<xs.length i xs.length xs xs.length i++ i++ i {
            xs[i] = scanner.nextInt();
            if(xs[i] == 0) {
                ans = i+1;
            }
        } {
            xs[i] = scanner.nextInt();
            if(xs[i] == 0) {
                ans = i+1;
            }
        } xs[i] = scanner.nextInt() xs[i] xs i scanner.nextInt() scanner.nextInt scanner if(xs[i] == 0) {
                ans = i+1;
            } xs[i] == 0 xs[i] xs 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 scanner = new Scanner(System.in);
        int[] xs = new int[5];
        int ans = 0;
        for(int i=0; i<xs.length; i++) {
            xs[i] = scanner.nextInt();
            if(xs[i] == 0) {
                ans = i+1;
            }
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] xs = new int[5];
        int ans = 0;
        for(int i=0; i<xs.length; i++) {
            xs[i] = scanner.nextInt();
            if(xs[i] == 0) {
                ans = i+1;
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] xs = new int[5];
        int ans = 0;
        for(int i=0; i<xs.length; i++) {
            xs[i] = scanner.nextInt();
            if(xs[i] == 0) {
                ans = i+1;
            }
        }
        System.out.println(ans);
    }
}