There is a house with n flats situated on the main street of Berlatov. Vova is watching this house every night. The house can be represented as an array of n integer numbers a_1, a_2, ..., a_n, where a_i = 1 if in the i-th flat the light is on and a_i = 0 otherwise.

Vova thinks that people in the i-th flats are disturbed and cannot sleep if and only if 1 < i < n and a_{i - 1} = a_{i + 1} = 1 and a_i = 0.

Vova is concerned by the following question: what is the minimum number k such that if people from exactly k pairwise distinct flats will turn off the lights then nobody will be disturbed? Your task is to find this number k.

Input

The first line of the input contains one integer n (3 ≤ n ≤ 100) — the number of flats in the house.

The second line of the input contains n integers a_1, a_2, ..., a_n (a_i ∈ \{0, 1\}), where a_i is the state of light in the i-th flat.

Output

Print only one integer — the minimum number k such that if people from exactly k pairwise distinct flats will turn off the light then nobody will be disturbed.

Examples

Input


10
1 1 0 1 1 0 1 0 1 0


Output


2


Input


5
1 1 0 0 0


Output


0


Input


4
1 1 1 1


Output


0

Note

In the first example people from flats 2 and 7 or 4 and 7 can turn off the light and nobody will be disturbed. It can be shown that there is no better answer in this example.

There are no disturbed people in second and third examples.
import java.io.*;
import java.math.BigInteger;
import java.util.*;


public class Main {

    private static List<List<Integer>> subsets;
    private static int count = 0;
    private static BigInteger thirteen = new BigInteger("13");
    private static BigInteger five = new BigInteger("5");
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);
        Scanner scanner = new Scanner(System.in);

        int n = in.nextInt();
        int [] a = new int[n];
        for (int i = 0; i < a.length; i++) {
            a[i] = in.nextInt();
        }
        int count = 0;
        for (int i = 1; i < a.length - 1; i++) {
            if(a[i] == 0 && a[i-1] == 1 && a[i+1] == 1) {
                count++;
                a[i+1] = 0;
            }
        }
        out.println(count);
        out.flush();
    }
    private static int lowerBound(String [] a, char letter) {
        int lo = 0;
        int hi = a.length - 1;
        while (lo<=hi) {
            int med = lo + (hi-lo)/2;
            if(letter <= a[med].charAt(0)) {
                hi = med - 1;
            }
            else {
                lo = med + 1;
            }
        }
        if(lo < 0 || lo >= a.length) return  -1;
        return a[lo].charAt(0) == letter ? lo : -1;
    }
    private static int upperBound(String [] a, char letter) {
        int lo = 0;
        int hi = a.length - 1;
        while (lo<=hi) {
            int med = lo + (hi-lo)/2;
            if(letter >= a[med].charAt(0)) {
                lo = med + 1;
            }
            else {
                hi = med - 1;
            }
        }
        return hi;
    }
    static List<Integer> del (int n) {
        List<Integer> list = new ArrayList<>();
        for (int i=1;i*i<=n;i++) {
            if(n%i==0) {
                list.add(i);
                if(i*i!=n) {
                    list.add(n/i);
                }
            }
        }
        return list;
    }
    static int sumOfNumbers(int n) {
        int sum = 0;
        while (n>0) {
            sum+=n%10;
            n/=10;
        }
        return sum;
    }
    static long binPow(long a, long b, long m) {
        //a %= m;
        long res = 1;
        while (b > 0) {
            if (b%2!=0) {
               res = res * a % m;
            }
            a = a * a % m;
            b >>= 1;
        }
        return res;
    }

    static boolean isPrime(long n) {
        if(n < 2) return false;
        for(long i = 2;i*i<=n;i++) {
            if(n%i==0) return false;
        }
        return true;
    }
    static long gcd(long a, long b) {
        return b == 0 ? a : gcd(b,a%b);
    }
    public boolean isPowerOfFour(int num) {
        int n = Integer.bitCount(num);
        String s = Integer.toBinaryString(num);
        if(n == 1 && s.length()%2!=0) return true;
        return false;
    }
    static boolean isAscending(int [] a) {
        for (int i = 0; i < a.length - 1; i++) {
            if(a[i+1] < a[i]) return false;
        }
        return true;
    }
    static boolean isDescending(int [] a) {
        for (int i = 0; i < a.length - 1; i++) {
            if(a[i+1] > a[i]) return false;
        }
        return true;
    }
    static void reverseArray(int [] a) {
        int i = 0;
        int j = a.length - 1;
        while (i<=j) {
            int temp = a[i];
            a[i] = a[j];
            a[j] = temp;
            i++;
            j--;
        }
    }
    static boolean isPossible(int [] a, int [] b) {
        for (int i = 0; i < 26; i++) {
            if(a[i] == 0  && b[i]!=0) return false;
        }
        return true;
    }
    private static int [] freq(String s) {
        int [] f = new int[26];
        for (char c : s.toCharArray()) {
            f[c-'a']++;
        }
        return f;
    }
    private static void dfs(HashMap<Integer,List<Integer>> map, HashMap<Integer,Long> values, int x, int v,HashSet<Integer> set) {
        if(!set.contains(x)) {
            values.put(x, values.getOrDefault(x, 0L) + v);
            set.add(x);
        }
        if(!map.containsKey(x)) {
            return;
        }
        List<Integer> list = map.get(x);
        for (int i = 0; i < list.size(); i++) {
            int key = list.get(i);
            if(!set.contains(key)) {
                values.put(key,values.get(key) +  v);
                set.add(key);
            }
        }
        for (int i = 0; i < list.size();i++) {
            int key = list.get(i);
            dfs(map,values,key,v,set);
        }
    }

    static double gcd(double a,double b) {
        return b == 0 ? a : gcd(b,a%b);
    }
}
class Point {
    int id;
    int value;

    public Point(int id, int value) {
        this.id = id;
        this.value = value;
    }
}

class InputReader extends BufferedReader {
    StringTokenizer tokenizer;

    public InputReader(InputStream inputStream) {
        super(new InputStreamReader(inputStream), 32768);
    }

    public InputReader(String filename) {
        super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }
        return tokenizer.nextToken();
    }
    public Integer nextInt() {return Integer.valueOf(next());}
    public Long nextLong() {return  Long.valueOf(next());}
    public Double nextDouble() {return Double.valueOf(next());}

    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream outputStream) {
            super(outputStream);
        }

        public OutputWriter(Writer writer) {
            super(writer);
        }

        public OutputWriter(String filename) throws FileNotFoundException {
            super(filename);
        }

        public void close() {
            super.close();
        }
    }
}