import java.util.Scanner;

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

public class Main {
    public static void main(String[] args) {
        try (Scanner scanner = new Scanner(System.in);) {
            for(int i = 0; i < 5; i++) {
                if(scanner.nextInt() == 0) {
                    System.out.println(i + 1);
                    return;
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
