Problem: George is a cat, so he really likes to play. Most of all he likes to play with his array of positive integers b. During the game, George modifies the array by using special changes. Let's mark George's current array as b1, b2, ..., b|b| (record |b| denotes the current length of the array). Then one change is a sequence of actions: 

  * Choose two distinct indexes i and j (1 ≤ i, j ≤ |b|; i ≠ j), such that bi ≥ bj. 
  * Get number v = concat(bi, bj), where concat(x, y) is a number obtained by adding number y to the end of the decimal record of number x. For example, concat(500, 10) = 50010, concat(2, 2) = 22. 
  * Add number v to the end of the array. The length of the array will increase by one. 
  * Remove from the array numbers with indexes i and j. The length of the array will decrease by two, and elements of the array will become re-numbered from 1 to current length of the array. 



George played for a long time with his array b and received from array b an array consisting of exactly one number p. Now George wants to know: what is the maximum number of elements array b could contain originally? Help him find this number. Note that originally the array could contain only positive integers.

Input

The first line of the input contains a single integer p (1 ≤ p < 10100000). It is guaranteed that number p doesn't contain any leading zeroes.

Output

Print an integer — the maximum number of elements array b could contain originally.

Examples

Input

9555


Output

4

Input

10000000005


Output

2

Input

800101


Output

3

Input

45


Output

1

Input

1000000000000001223300003342220044555


Output

17

Input

19992000


Output

1

Input

310200


Output

2

Note

Let's consider the test examples: 

  * Originally array b can be equal to {5, 9, 5, 5}. The sequence of George's changes could have been: {5, 9, 5, 5} → {5, 5, 95} → {95, 55} → {9555}. 
  * Originally array b could be equal to {1000000000, 5}. Please note that the array b cannot contain zeros. 
  * Originally array b could be equal to {800, 10, 1}. 
  * Originally array b could be equal to {45}. It cannot be equal to {4, 5}, because George can get only array {54} from this array in one operation. 



Note that the numbers can be very large.

Solution (in JAVA):

Solution:
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(final String[] args) throws IOException {
        try(Scanner scan = new Scanner(System.in);
            PrintWriter print = new PrintWriter(System.out)) {
            final String s = scan.next();
            print.println(calcMaxNumNAscPosNumSeq(s));
        }
    }

    public static int calcMaxNumNAscPosNumSeq(final String wholeNumber) {
        int result = 0;
        int j = 0;
        for(int i = wholeNumber.length(); i > 0; i = j) {
            for(j = i - 1; wholeNumber.charAt(j) == '0'; --j);
            ++result;
            if(j == 0 || j < i - j || (j == i - j &&
                    wholeNumber.substring(0, j).compareTo(wholeNumber.substring(j, i)) < 0)) {
                break;
            }
        }
        return result;
    }



    public static class MatrixIntMod {
        final int mod;
        final int[][] data;

        public MatrixIntMod(final int n, final int m, final int mod) {
            this.mod = mod;
            this.data = new int[n][m];
            for(int i = 0; i < n; ++i) {
                Arrays.fill(data[i], 0);
            }
        }

        public MatrixIntMod(final int[][] data, final int mod) {
            this(data.length, data[0].length, mod);
            for(int i = 0; i < data.length; ++i) {
                for(int j = 0; j < data[i].length; ++j) {
                    this.data[i][j] = ModNumberUtils.norm(mod, data[i][j]);
                }
            }
        }

        public MatrixIntMod(final int[] data, final int mod) {
            this(data.length, 1, mod);
            for(int i = 0; i < data.length; ++i) {
                this.data[i][0] = ModNumberUtils.norm(mod, data[i]);
            }
        }

        public int[] all() {
            int n = data.length;
            int m = data[0].length;
            final int[] res = new int[n * m];
            int k = 0;
            for(int i = 0; i < n; ++i) {
                for(int j = 0; j < m; ++j) {
                    res[k++] = data[i][j];
                }
            }
            return res;
        }

        public MatrixIntMod mult(final MatrixIntMod val) {
            if(data[0].length != val.data.length) throw new RuntimeException("dimensions for mult are wrong");
            final int n = data.length;
            final int m = data[0].length;
            final int l = val.data[0].length;
            final MatrixIntMod res = new MatrixIntMod(n, l, mod);
            for(int i = 0; i < n; ++i) {
                for(int j = 0; j < l; ++j) {
                    for(int k = 0; k < m; ++k) {
                        res.data[i][j] = ModNumberUtils.add(mod, res.data[i][j],
                                ModNumberUtils.mult(mod, data[i][k], val.data[k][j]));
                    }
                }
            }
            return res;
        }

        public int[] mult(final int[] ar) {
            return mult(new MatrixIntMod(ar, mod)).all();
        }

        public MatrixIntMod power(final long t) {
            if(t == 0) return eye(data.length, mod);
            MatrixIntMod res = power(t >> 1);
            res = res.mult(res);
            if((t & 1) == 1) {
                res = res.mult(this);
            }
            return res;
        }

        public static MatrixIntMod eye(final int n, final int mod) {
            final MatrixIntMod res = new MatrixIntMod(n, n, mod);
            if(mod > 1) {
                for(int i = 0; i < n; ++i) {
                    res.data[i][i] = 1;
                }
            }
            return res;
        }
    }

    public static class ModNumberUtils {
        public static int add(int mod, int a, int b) {
            a += b;
            if(a >= mod) {
                a -= mod;
            }
            return a;
        }

        public static int norm(int mod, int a) {
            a %= mod;
            if(a < 0) {
                a += mod;
            }
            return a;
        }

        public static int mult(int mod, int a, int b) {
            return (int)((long)a * b % mod);
        }
    }

    public static class Pair<X, Y>{
        public X first;
        public Y second;

        public Pair(final X first, final Y second) {
            this.first = first;
            this.second = second;
        }
    }


    public static class NumberUtils {
        public static interface Factorizer {
            List<Integer> factorize(int number);
        }

        /**
         * thread safe Factorizer
         */
        public static Factorizer createSmallNumberFactorizer(final int upperBound) {
            return new SmallNumberFactorizer(upperBound);
        }

        /**
         * thread safe
         */
        private static class SmallNumberFactorizer implements Factorizer {
            private int[] divisors;
            private final int upperBound;
            private boolean prepared = false;

            /**
             * lazy
             * time complexity O(n * log(n) * log(log(n))
             * memory complexity O(n)
             */
            public SmallNumberFactorizer(final int upperBound) {
                this.upperBound = upperBound;
            }

            private synchronized void prepare() {
                divisors = new int[upperBound];
                Arrays.fill(divisors, 0);
                for(int i = 2; i * i < upperBound; ++i) {
                    if(divisors[i] == 0) {
                        for(int j = i * i; j < upperBound; j += i) {
                            if(divisors[j] == 0) {
                                divisors[j] = i;
                            }
                        }
                    }
                }
                prepared = true;
            }

            /**
             * complexity O(result)
             */
            public List<Integer> factorize(int number) {
                synchronized (this) {
                    if(!prepared) {
                        prepare();
                    }
                }
                final List<Integer> result = CollectionFactory.createArrayList();
                if(number < 2) return result;
                if(number >= upperBound) throw new RuntimeException("number should be less than upper bound");
                while(divisors[number] > 0) {
                    result.add(divisors[number]);
                    number /= divisors[number];
                }
                result.add(number);
                return result;
            }
        }
    }

    public static class CollectionFactory {
        public static<T> List<T> createArrayList() {
            return new ArrayList<>();
        }

        public static<T> List<T> createArrayList(final int capacity) {
            return new ArrayList<>(capacity);
        }
    }

    public static class CollectionUtils {
        public static<T> List<T> unique(final List<T> list) {
            final List<T> result = CollectionFactory.createArrayList();
            T p = null;
            for(T elem : list) {
                if(!elem.equals(p)) {
                    result.add(elem);
                    p = elem;
                }
            }
            return result;
        }

        public static<T extends Comparable<T>> T max(final List<T> list, final T lowerBound) {
            T result = lowerBound;
            for(T elem : list) {
                if(elem.compareTo(result) > 0) {
                    result = elem;
                }
            }
            return result;
        }
    }

}