import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
		// 整数の入力
        
        int[] num = new int[5];
        
        int ans = 0;

        for(int i = 0;i < 5;i++){
            num[i] = sc.nextInt();
        }
		for(int i = 0;i < 5;i++){
            if(num[i] == 0) ans = i+1;
        }
		// 出力
		System.out.println(ans);

    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
		// 整数の入力
        
        int[] num = new int[5];
        
        int ans = 0;

        for(int i = 0;i < 5;i++){
            num[i] = sc.nextInt();
        }
		for(int i = 0;i < 5;i++){
            if(num[i] == 0) ans = i+1;
        }
		// 出力
		System.out.println(ans);

    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
		// 整数の入力
        
        int[] num = new int[5];
        
        int ans = 0;

        for(int i = 0;i < 5;i++){
            num[i] = sc.nextInt();
        }
		for(int i = 0;i < 5;i++){
            if(num[i] == 0) ans = i+1;
        }
		// 出力
		System.out.println(ans);

    } main {
        Scanner sc = new Scanner(System.in);
		// 整数の入力
        
        int[] num = new int[5];
        
        int ans = 0;

        for(int i = 0;i < 5;i++){
            num[i] = sc.nextInt();
        }
		for(int i = 0;i < 5;i++){
            if(num[i] == 0) ans = i+1;
        }
		// 出力
		System.out.println(ans);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] num = new int[5]; num new int[5] 5 int ans = 0; ans 0 for(int i = 0;i < 5;i++){
            num[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            num[i] = sc.nextInt();
        } {
            num[i] = sc.nextInt();
        } num[i] = sc.nextInt() num[i] num i sc.nextInt() sc.nextInt sc for(int i = 0;i < 5;i++){
            if(num[i] == 0) ans = i+1;
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            if(num[i] == 0) ans = i+1;
        } {
            if(num[i] == 0) ans = i+1;
        } if(num[i] == 0) ans = i+1; num[i] == 0 num[i] num i 0 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) throws Exception {
        Scanner sc = new Scanner(System.in);
		// 整数の入力
        
        int[] num = new int[5];
        
        int ans = 0;

        for(int i = 0;i < 5;i++){
            num[i] = sc.nextInt();
        }
		for(int i = 0;i < 5;i++){
            if(num[i] == 0) ans = i+1;
        }
		// 出力
		System.out.println(ans);

    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
		// 整数の入力
        
        int[] num = new int[5];
        
        int ans = 0;

        for(int i = 0;i < 5;i++){
            num[i] = sc.nextInt();
        }
		for(int i = 0;i < 5;i++){
            if(num[i] == 0) ans = i+1;
        }
		// 出力
		System.out.println(ans);

    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
		// 整数の入力
        
        int[] num = new int[5];
        
        int ans = 0;

        for(int i = 0;i < 5;i++){
            num[i] = sc.nextInt();
        }
		for(int i = 0;i < 5;i++){
            if(num[i] == 0) ans = i+1;
        }
		// 出力
		System.out.println(ans);

    }
}