import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner( System.in );

        for(int i=0; i<5; i++){
            if(Integer.parseInt(scan.next()) == 0  ){
                System.out.println(i+1);
            }            
        }

    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner( System.in );

        for(int i=0; i<5; i++){
            if(Integer.parseInt(scan.next()) == 0  ){
                System.out.println(i+1);
            }            
        }

    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner( System.in );

        for(int i=0; i<5; i++){
            if(Integer.parseInt(scan.next()) == 0  ){
                System.out.println(i+1);
            }            
        }

    } main {
        Scanner scan = new Scanner( System.in );

        for(int i=0; i<5; i++){
            if(Integer.parseInt(scan.next()) == 0  ){
                System.out.println(i+1);
            }            
        }

    } Scanner scan = new Scanner( System.in ); scan new Scanner( System.in ) for(int i=0; i<5; i++){
            if(Integer.parseInt(scan.next()) == 0  ){
                System.out.println(i+1);
            }            
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            if(Integer.parseInt(scan.next()) == 0  ){
                System.out.println(i+1);
            }            
        } {
            if(Integer.parseInt(scan.next()) == 0  ){
                System.out.println(i+1);
            }            
        } if(Integer.parseInt(scan.next()) == 0  ){
                System.out.println(i+1);
            } Integer.parseInt(scan.next()) == 0 Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan 0 {
                System.out.println(i+1);
            } System.out.println(i+1) System.out.println System.out System System.out i+1 i 1 String[] args args public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner( System.in );

        for(int i=0; i<5; i++){
            if(Integer.parseInt(scan.next()) == 0  ){
                System.out.println(i+1);
            }            
        }

    }
} public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner( System.in );

        for(int i=0; i<5; i++){
            if(Integer.parseInt(scan.next()) == 0  ){
                System.out.println(i+1);
            }            
        }

    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner( System.in );

        for(int i=0; i<5; i++){
            if(Integer.parseInt(scan.next()) == 0  ){
                System.out.println(i+1);
            }            
        }

    }
}