In the city of Saint Petersburg, a day lasts for 2^{100} minutes. From the main station of Saint Petersburg, a train departs after 1 minute, 4 minutes, 16 minutes, and so on; in other words, the train departs at time 4^k for each integer k ≥ 0. Team BowWow has arrived at the station at the time s and it is trying to count how many trains have they missed; in other words, the number of trains that have departed strictly before time s. For example if s = 20, then they missed trains which have departed at 1, 4 and 16. As you are the only one who knows the time, help them!

Note that the number s will be given you in a [binary representation](https://en.wikipedia.org/wiki/Binary_number#Representation) without leading zeroes.

Input

The first line contains a single binary number s (0 ≤ s < 2^{100}) without leading zeroes.

Output

Output a single number — the number of trains which have departed strictly before the time s.

Examples

Input


100000000


Output


4


Input


101


Output


2


Input


10100


Output


3

Note

In the first example 100000000_2 = 256_{10}, missed trains have departed at 1, 4, 16 and 64.

In the second example 101_2 = 5_{10}, trains have departed at 1 and 4.

The third example is explained in the statements.
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.io.ObjectInputStream.GetField;
import java.security.KeyStore.Entry;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class codeforcesreturn {
	public static class Pair implements Comparable<Pair> {
		int start;
		int end;

		public Pair(int start, int end) {
			super();
			this.start = start;
			this.end = end;
		}

		@Override
		public int compareTo(Pair p) {
			if (start == p.start)
				return end - p.end;
			return start - p.start;
		}

	}

	public static class UnionFind {
		int[] p, rank;
		boolean[] cyclic;

		public UnionFind(int N) {
			p = new int[N];
			rank = new int[N];
			// cyclic = new boolean[N];
			for (int i = 0; i < N; i++)
				p[i] = i;
		}

		public int findSet(int x) {
			return p[x] == x ? x : (p[x] = findSet(p[x]));
		}

		public boolean isunioned(int x, int y) {
			return findSet(x) == findSet(y);
		}

		public boolean union(int x, int y) {
			x = findSet(x);
			y = findSet(y);
			if (x == y) {
				return false;
			}
			if (rank[x] > rank[y])
				p[y] = x;
			else {
				p[x] = y;
				if (rank[x] == rank[y])
					++rank[y];
			}
			return true;
		}
	}

	static ArrayList<Integer>[] adjlist;
	static int[][] adjmatrix;
	static int[][] adjmatrix2;
	static boolean[] vis;
	static boolean[] intialvis;
	static boolean[] vis2;
	static Stack<Integer> st;
	static ArrayList<Integer> arrylist;
	static boolean flag;
	static int[] dx = new int[] { 1, -1, 0, 0 };
	static int[] dy = new int[] { 0, 0, 1, -1 };
	static boolean ans = true;;
	static int[] dist, parent;
	static boolean[] visited;
	static int src, dest;

	public static void SSSP_BFS(int u) {

		src = u;
		Queue<Integer> q = new LinkedList<>();
		visited = new boolean[adjList.length];
		dist = new int[adjList.length];
		parent = new int[adjList.length];
		dist[u] = 0;
		parent[u] = -1;
		visited[u] = true;
		q.add(u);
		while (!q.isEmpty()) {
			int num = q.poll();
			for (int v : adjList[num]) {
				if (!visited[v]) {
					visited[v] = true;
					q.add(v);
					parent[v] = num;
					dist[v] = dist[num] + 1;
				}
			}
		}
	}

	public static void getPath(int u) {// u is the destination in the
										// initial call
		if (u == src) {
			System.out.print(src + " ");
			return;
		}
		getPath(parent[u]);
		System.out.print(u + " ");
	}

	static int INF = (int) 1e9;// to avoid overflow
	static ArrayList<Pair>[] adjListWeighted;

	public static long gcd(long u, long v) {
		if (u == 0)
			return v;
		return gcd(v % u, u);
	}

	static long pow(long a, long n) {
		long res = 1;
		while (n != 0) {
			if ((n & 1) == 1)
				res *= a;
			a *= a;
			n >>= 1;
		}
		return res;
	}

	public static void bib(int u) {

		vis[u] = true;
		for (int v : adjlist[u]) {
			if (!vis[v]) {
				counter[v] = 1 ^ counter[u];
				bib(v);
			} else if (counter[v] != (1 ^ counter[u]))
				ans = false;

		}
	}

	static int n, p;
	static int[] rock, sc, pap;
	static double[][] memo;

	public static double dp(int type, int rem) {
		if (rem <= 0)
			if (type == 0)
				return 1;
			else
				return 0;

		if (type == 0) {

			double nonking = (rem - 1) / rem;
			double king = 1.0 / rem;
			// Caoimhe turn :
			double nonking1 = nonking;
			nonking1 *= dp(0, rem - 2);
			double nonking2 = (king - 1.0) / king;
			nonking2 *= dp(1, rem - 1);
			double acc = nonking1 + nonking2;
			double king2 = 1.0 / king;
			return acc / (1 - king2);
		} else {
			double nonking = rem;
			// Caoimhe turn :
			double nonking1 = (nonking - 1.0) / nonking;
			nonking1 *= dp(1, rem - 2);
			double king1 = 1.0 / nonking;
			king1 *= dp(0, rem - 1);
			double acc = nonking1 + king1;
			return acc;
		}

	}

	public static long cieel(long n, long d) {
		if (n % d == 0)
			return n / d;
		return (n / d) + 1;
	}

	static ArrayList<Integer>[] adjList;
	static int V, E, counter[], c, SCC, dfs_num[], dfs_low[], Arr[];
	static int[] inSCC, cost;
	static Stack<Integer> stack;
	static PrintWriter pw;
	static long minn = 0, num = 1;

	static void tarjanSCC() // O(V + E)
	{
		for (int i = 0; i < V; ++i)
			if (dfs_num[i] == 0)
				tarjanSCC(i);
	}

	static void tarjanSCC(int u) {
		dfs_num[u] = dfs_low[u] = ++c;
		stack.push(u);

		for (int v : adjList[u]) {
			if (dfs_num[v] == 0)
				tarjanSCC(v);
			if (inSCC[v] == -1)
				dfs_low[u] = Math.min(dfs_low[u], dfs_low[v]);
		}
		if (dfs_num[u] == dfs_low[u]) {
			// SCC found
			SCC++;
			long min = cost[u];
			long numberofmin = 1;
			while (true) {
				int v = stack.pop();
				inSCC[v] = u;
				if (v == u)
					break;
				int cos = cost[v];
				if (cos < min) {
					min = cos;
					numberofmin = 1;
				} else if (cos == min)
					numberofmin++;
			}
			minn += min;
			num *= numberofmin;
			num %= 1000000007;
		}
		pw.close();
	}

	public static int backtrack(int i, int boysnum, int accmask) {
		if (i == p + 1) {
			return boysnum + Integer.bitCount(accmask);
		}
		int take;
		if (accmask < 1 << 22)
			take = backtrack(i + 1, boysnum + 1, accmask & Arr[i]);
		else
			take = backtrack(i + 1, boysnum + 1, Arr[i]);
		int leave = backtrack(i + 1, boysnum, accmask);
		return Math.max(take, leave);
	}

	public static void main(String[] args) throws IOException, InterruptedException {
		// FileWriter f = new FileWriter("C:\\Users\\Hp\\Desktop\\out.txt");
		// PrintWriter pw = new PrintWriter(f);
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		Scanner sc = new Scanner(System.in);
		// int n = sc.nextInt();
		String str = sc.next();
		int n = str.length();
		if (n % 2 == 0) {
			System.out.println(n / 2);
			return;
		}
		int ans = n / 2 ;
		for (int i = 1; i < n; i++)
			if (str.charAt(i) == '1') {
				ans++;
				break;
			}
		System.out.println(ans);
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}

}