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.*;
import java.math.*;
import java.util.*;
import java.lang.*;

public class Main{ 

    public static InputStream inputStream = System.in;
    public static OutputStream outputStream = System.out;
    public static FastReader in = new FastReader(inputStream);
    public static PrintWriter out = new PrintWriter(outputStream);
    
    int n;
    int m;
    int t;

    public static void main(String[] args)throws java.lang.Exception{
        new Main().run();
        out.close();
    }

    String s;
    
    void run()throws java.lang.Exception{
        s = in.nextLine();
        n = s.length();
//      System.out.println("n = " + n);
        System.out.println(best(n-1));
    }
    
    int best(int from){
//      int ans = 0;
//      while(true){
////            System.out.println("from = " + from);
//          if(from==0){
//              return 1+ans;
//          }
//          int cur = from;
//          for(int i=from; i>=1; i--){
//              String s1 = s.substring(0, i);
//              String s2 = s.substring(i, from+1);
//              if(s2.charAt(0)=='0'){
//                  continue;
//              }
//              if(s1.length()>s2.length()){
//                  ans++;
//                  from = i-1;
//                  break;
//              }else if(s1.length()<s2.length()){
//                  ans++;
//                  return ans;
//              }else if(s1.compareTo(s2)>=0){
//                  ans++;
//                  from = i-1;
//                  break;
//              }
//          }
//          if(from==cur){
//              return 1+ans;
//          }
//      }
//      System.out.println("\n" + from + " called");
        for(int i=from; i>=1; i--){
            String s1 = s.substring(0, i);
            String s2 = s.substring(i, from+1);
            if(s2.charAt(0)=='0'){
                continue;
            }
            if(s1.length()>s2.length()){
                return 1 + best(i-1);
            }else if(s1.length()<s2.length()){
                break;
            }else if(s1.compareTo(s2)>=0){
                return 1 + best(i-1);
            }
        }
        return 1;
    }
}

class Obj implements Comparable<Obj>{
    int lo;
    int hi;
    int c;

    public Obj(int a, int b, int c){
        lo = a;
        hi = b;
        this.c = c;
    }

    public int compareTo(Obj that){
        return Integer.valueOf(c).compareTo(that.c);
    }
}

class ArrayUtils{
    public static void printGraph(ArrayList<Integer>[] graph){
        System.out.println("GRAPH : ");
        int N = graph.length;
        for(int i=0; i<N; i++){
            System.out.print(i + " -> ");
            for(Integer x : graph[i]){
                System.out.print(x + ", ");
            }
            System.out.println();
        }
    }

    public static void initGraph(ArrayList<Integer>[] graph){
        for(int i=0; i<graph.length; i++){
            graph[i] = new ArrayList<Integer>();
        }
    }

    public static void fill2d(long[][] arr){
        for(int i=0; i<arr.length; i++){
            Arrays.fill(arr[i], -1L);
        }
    }

    public static void fill2d(int[][] arr){
        for(int i=0; i<arr.length; i++){
            Arrays.fill(arr[i], -1);
        }
    }

    public static void input2d(int[][] arr, FastReader in){
        for(int i=0; i<arr.length; i++){
            for(int j=0; j<arr[0].length; j++){
                arr[i][j] = in.nextInt();
            }
        }
    }

    public static void input1d(int[] arr, FastReader in){
        for(int i=0; i<arr.length; i++){
            arr[i] = in.nextInt();
        }
    }

    public static void printGrid(char[][] arr){
        System.out.println("Character grid : ");
        for(int i=0; i<arr.length; i++){
            for(int j=0; j<arr[i].length; j++){
                System.out.print(arr[i][j]);
            }
            System.out.println();
        }
        System.out.println("--------------------------------------");
    }
}


class FastReader{
    private boolean finished = false;

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public FastReader(InputStream stream){
        this.stream = stream;
    }

    public int read(){
        if (numChars == -1){
            throw new InputMismatchException ();
        }
        if (curChar >= numChars){
            curChar = 0;
            try{
                numChars = stream.read (buf);
            } catch (IOException e){
                throw new InputMismatchException ();
            }
            if (numChars <= 0){
                return -1;
            }
        }
        return buf[curChar++];
    }

    public int peek(){
        if (numChars == -1){
            return -1;
        }
        if (curChar >= numChars){
            curChar = 0;
            try{
                numChars = stream.read (buf);
            } catch (IOException e){
                return -1;
            }
            if (numChars <= 0){
                return -1;
            }
        }
        return buf[curChar];
    }

    public int nextInt(){
        int c = read ();
        while (isSpaceChar (c))
            c = read ();
        int sgn = 1;
        if (c == '-'){
            sgn = -1;
            c = read ();
        }
        int res = 0;
        do{
            if(c==','){
                c = read();
            }
            if (c < '0' || c > '9'){
                throw new InputMismatchException ();
            }
            res *= 10;
            res += c - '0';
            c = read ();
        } while (!isSpaceChar (c));
        return res * sgn;
    }

    public long nextLong(){
        int c = read ();
        while (isSpaceChar (c))
            c = read ();
        int sgn = 1;
        if (c == '-'){
            sgn = -1;
            c = read ();
        }
        long res = 0;
        do{
            if (c < '0' || c > '9'){
                throw new InputMismatchException ();
            }
            res *= 10;
            res += c - '0';
            c = read ();
        } while (!isSpaceChar (c));
        return res * sgn;
    }

    public String nextString(){
        int c = read ();
        while (isSpaceChar (c))
            c = read ();
        StringBuilder res = new StringBuilder ();
        do{
            res.appendCodePoint (c);
            c = read ();
        } while (!isSpaceChar (c));
        return res.toString ();
    }

    public boolean isSpaceChar(int c){
        if (filter != null){
            return filter.isSpaceChar (c);
        }
        return isWhitespace (c);
    }

    public static boolean isWhitespace(int c){
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0(){
        StringBuilder buf = new StringBuilder ();
        int c = read ();
        while (c != '\n' && c != -1){
            if (c != '\r'){
                buf.appendCodePoint (c);
            }
            c = read ();
        }
        return buf.toString ();
    }

    public String nextLine(){
        String s = readLine0 ();
        while (s.trim ().length () == 0)
            s = readLine0 ();
        return s;
    }

    public String nextLine(boolean ignoreEmptyLines){
        if (ignoreEmptyLines){
            return nextLine ();
        }else{
            return readLine0 ();
        }
    }

    public BigInteger nextBigInteger(){
        try{
            return new BigInteger (nextString ());
        } catch (NumberFormatException e){
            throw new InputMismatchException ();
        }
    }

    public char nextCharacter(){
        int c = read ();
        while (isSpaceChar (c))
            c = read ();
        return (char) c;
    }

    public double nextDouble(){
        int c = read ();
        while (isSpaceChar (c))
            c = read ();
        int sgn = 1;
        if (c == '-'){
            sgn = -1;
            c = read ();
        }
        double res = 0;
        while (!isSpaceChar (c) && c != '.'){
            if (c == 'e' || c == 'E'){
                return res * Math.pow (10, nextInt ());
            }
            if (c < '0' || c > '9'){
                throw new InputMismatchException ();
            }
            res *= 10;
            res += c - '0';
            c = read ();
        }
        if (c == '.'){
            c = read ();
            double m = 1;
            while (!isSpaceChar (c)){
                if (c == 'e' || c == 'E'){
                    return res * Math.pow (10, nextInt ());
                }
                if (c < '0' || c > '9'){
                    throw new InputMismatchException ();
                }
                m /= 10;
                res += (c - '0') * m;
                c = read ();
            }
        }
        return res * sgn;
    }

    public boolean isExhausted(){
        int value;
        while (isSpaceChar (value = peek ()) && value != -1)
            read ();
        return value == -1;
    }

    public String next(){
        return nextString ();
    }

    public SpaceCharFilter getFilter(){
        return filter;
    }

    public void setFilter(SpaceCharFilter filter){
        this.filter = filter;
    }

    public interface SpaceCharFilter{
        public boolean isSpaceChar(int ch);
    }
}