import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.lang.Math;
import java.util.Map;

public class Main {

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        int[] ar = fs.readArray(5);

        for (int i =0; i<5;i++) {
            if (ar[i] == 0) {
                System.out.println(i+1);
            }
        }






    }
    public static String convertFromBaseToBase(String str, int fromBase, int toBase) {
        return Integer.toString(Integer.parseInt(str, fromBase), toBase);
    }


    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");

        public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
    }

}
 import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.*; util.* java import java.lang.Math; Math java.lang import java.util.Map; Map java.util public class Main {

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        int[] ar = fs.readArray(5);

        for (int i =0; i<5;i++) {
            if (ar[i] == 0) {
                System.out.println(i+1);
            }
        }






    }
    public static String convertFromBaseToBase(String str, int fromBase, int toBase) {
        return Integer.toString(Integer.parseInt(str, fromBase), toBase);
    }


    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");

        public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
    }

} Main public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        int[] ar = fs.readArray(5);

        for (int i =0; i<5;i++) {
            if (ar[i] == 0) {
                System.out.println(i+1);
            }
        }






    } main {
        FastScanner fs = new FastScanner();
        int[] ar = fs.readArray(5);

        for (int i =0; i<5;i++) {
            if (ar[i] == 0) {
                System.out.println(i+1);
            }
        }






    } FastScanner fs = new FastScanner(); fs new FastScanner() int[] ar = fs.readArray(5); ar fs.readArray(5) fs.readArray fs 5 for (int i =0; i<5;i++) {
            if (ar[i] == 0) {
                System.out.println(i+1);
            }
        } int i =0; int i =0; i 0 i<5 i 5 i++ i++ i {
            if (ar[i] == 0) {
                System.out.println(i+1);
            }
        } {
            if (ar[i] == 0) {
                System.out.println(i+1);
            }
        } if (ar[i] == 0) {
                System.out.println(i+1);
            } ar[i] == 0 ar[i] ar i 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 static String convertFromBaseToBase(String str, int fromBase, int toBase) {
        return Integer.toString(Integer.parseInt(str, fromBase), toBase);
    } convertFromBaseToBase {
        return Integer.toString(Integer.parseInt(str, fromBase), toBase);
    } return Integer.toString(Integer.parseInt(str, fromBase), toBase); Integer.toString(Integer.parseInt(str, fromBase), toBase) Integer.toString Integer Integer.parseInt(str, fromBase) Integer.parseInt Integer str fromBase toBase String str str int fromBase fromBase int toBase toBase static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");

        public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
    } FastScanner BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringTokenizer st=new StringTokenizer(""); st new StringTokenizer("") public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        } next {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        } while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                } !st.hasMoreElements() st.hasMoreElements() st.hasMoreElements st try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                } IOException e {
                    e.printStackTrace();
                } e.printStackTrace() e.printStackTrace e {
                    st=new StringTokenizer(br.readLine());
                } st=new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st int nextInt() {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        } readArray {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        } int[] a=new int[n]; a new int[n] n for (int i=0; i<n; i++) a[i]=nextInt(); int i=0; int i=0; i 0 i<n i n i++ i++ i a[i]=nextInt(); a[i]=nextInt() a[i] a i nextInt() nextInt return a; a int n n public class Main {

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        int[] ar = fs.readArray(5);

        for (int i =0; i<5;i++) {
            if (ar[i] == 0) {
                System.out.println(i+1);
            }
        }






    }
    public static String convertFromBaseToBase(String str, int fromBase, int toBase) {
        return Integer.toString(Integer.parseInt(str, fromBase), toBase);
    }


    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");

        public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
    }

} public class Main {

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        int[] ar = fs.readArray(5);

        for (int i =0; i<5;i++) {
            if (ar[i] == 0) {
                System.out.println(i+1);
            }
        }






    }
    public static String convertFromBaseToBase(String str, int fromBase, int toBase) {
        return Integer.toString(Integer.parseInt(str, fromBase), toBase);
    }


    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");

        public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
    }

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.lang.Math;
import java.util.Map;

public class Main {

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        int[] ar = fs.readArray(5);

        for (int i =0; i<5;i++) {
            if (ar[i] == 0) {
                System.out.println(i+1);
            }
        }






    }
    public static String convertFromBaseToBase(String str, int fromBase, int toBase) {
        return Integer.toString(Integer.parseInt(str, fromBase), toBase);
    }


    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");

        public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
    }

}

