import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }

    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[] A = new int[5];
        for (int i = 0; i < 5; i++) {
            A[i] = scan.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            if (A[i] == 0) {
                System.out.println(i + 1);
                return;
            }
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }

    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[] A = new int[5];
        for (int i = 0; i < 5; i++) {
            A[i] = scan.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            if (A[i] == 0) {
                System.out.println(i + 1);
                return;
            }
        }
    }
} Main public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    } main {
        Main main = new Main();
        main.solve();
    } Main main = new Main(); main new Main() main.solve() main.solve main String[] args args public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[] A = new int[5];
        for (int i = 0; i < 5; i++) {
            A[i] = scan.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            if (A[i] == 0) {
                System.out.println(i + 1);
                return;
            }
        }
    } solve {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[] A = new int[5];
        for (int i = 0; i < 5; i++) {
            A[i] = scan.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            if (A[i] == 0) {
                System.out.println(i + 1);
                return;
            }
        }
    } Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in))); scan new Scanner(new BufferedReader(new InputStreamReader(System.in))) int[] A = new int[5]; A new int[5] 5 for (int i = 0; i < 5; i++) {
            A[i] = scan.nextInt();
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            A[i] = scan.nextInt();
        } {
            A[i] = scan.nextInt();
        } A[i] = scan.nextInt() A[i] A i scan.nextInt() scan.nextInt scan for (int i = 0; i < 5; i++) {
            if (A[i] == 0) {
                System.out.println(i + 1);
                return;
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            if (A[i] == 0) {
                System.out.println(i + 1);
                return;
            }
        } {
            if (A[i] == 0) {
                System.out.println(i + 1);
                return;
            }
        } if (A[i] == 0) {
                System.out.println(i + 1);
                return;
            } A[i] == 0 A[i] A i 0 {
                System.out.println(i + 1);
                return;
            } System.out.println(i + 1) System.out.println System.out System System.out i + 1 i 1 return; public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }

    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[] A = new int[5];
        for (int i = 0; i < 5; i++) {
            A[i] = scan.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            if (A[i] == 0) {
                System.out.println(i + 1);
                return;
            }
        }
    }
} public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }

    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[] A = new int[5];
        for (int i = 0; i < 5; i++) {
            A[i] = scan.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            if (A[i] == 0) {
                System.out.println(i + 1);
                return;
            }
        }
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }

    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[] A = new int[5];
        for (int i = 0; i < 5; i++) {
            A[i] = scan.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            if (A[i] == 0) {
                System.out.println(i + 1);
                return;
            }
        }
    }
}
