import java.util.*;
public class Main {
    public void solve() {
        Scanner scan = new Scanner(System.in);
    int[]X = new int[5];
    for(int i=0;i<=4;i++){X[i]=scan.nextInt();
    if(X[i]==0)System.out.println(i+1);}

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

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

    } solve {
        Scanner scan = new Scanner(System.in);
    int[]X = new int[5];
    for(int i=0;i<=4;i++){X[i]=scan.nextInt();
    if(X[i]==0)System.out.println(i+1);}

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

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

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

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