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 \geq 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 without leading zeroes.


-----Input-----

The first line contains a single binary number $s$ ($0 \leq 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.

Difficulty: EASY

Solutions:
s = input()
if s == '0' or s == '1':
	print(0)
else:
	x = len(s)
	if x % 2 != 0 and '1' not in s[1:]:
		print((x - 1) // 2)
	else:
		print((x + 1) // 2)


import math
s = input()
p = 0
for i in range(0, len(s)):
	if s[i] == '1':
		p = p + 2 ** (len(s) - 1 - i)
flag = 0
for i in range(0, 100):
	if p <= pow(4, i):
		flag = i
		break
print(flag)


a = str(input())
b = int(a, 2)
count = 0
k = 0
while b > 4 ** k:
	count = count + 1
	k = k + 1
print(count)


def solution(x):
	if x <= 1:
		return 0
	return (len(str(x - 1)) + 1) // 2
x = int(input())
print(solution(x))


from sys import stdin, stdout
s = str(input())
n = len(s) - 1
if n % 2 == 0:
	ok = 0
	for i in range(1, n + 1):
		if s[i] == '1':
			ok = 1
			break
	if ok:
		print(n // 2 + 1)
	else:
		print(n // 2)
else:
	print(n // 2 + 1)


s = input()
c1 = 0
for i in s:
	if i == '1':
		c1 += 1
if s == '0':
	print(0)
elif len(s) % 2 == 0:
	print(len(s) // 2)
elif c1 > 1:
	print(len(s) // 2 + 1)
else:
	print(len(s) // 2)


import math
bin = int(input(), 2)
i = 0
trem = 4 ** i
num = 0
while trem < bin:
	i += 1
	trem = 4 ** i
	num += 1
print(num)


def bowwow(ctime):
	ctime = int(ctime, 2)
	count = 0
	check = 1
	while check < ctime:
		count += 1
		check *= 4
	return count
print(bowwow(input()))


n = int(input(), 2)
(ans, i) = (0, 1)
while i < n:
	ans += 1
	i *= 4
print(ans)


from math import log
s = input()
a = 0
for i in range(len(s)):
	a += int(s[i]) * 2 ** (len(s) - i - 1)
if a <= 1:
	print(0)
else:
	pw = int(log(a, 4))
	while 4 ** pw >= a:
		pw -= 1
	print(pw + 1)


n = int(input(), 2)
a = 1
for i in range(101):
	if n <= a:
		print(i)
		break
	a *= 4


s = input()
a = int(s, 2)
i = 1
ans = 0
while i < a:
	ans = ans + 1
	i = i * 4
print(ans)


n = int(input().strip(), 2)
x = 1
ans = 0
while x < n:
	ans += 1
	x *= 4
print(ans)


n = int(input(), 2)
(i, c) = (0, 0)
while pow(4, i) < n:
	c = c + 1
	i = i + 1
print(c)


from math import sqrt, pow, ceil
s = list(input())
s.reverse()
d = 0
for i in range(len(s)):
	d += int(s[i]) * 2 ** i
i = 0
p = 0
while 1:
	p = 4 ** i
	i += 1
	if p >= d:
		ans = i
		break
if p >= d:
	print(ans - 1)
else:
	print(ans)


from sys import stdin, stdout
import math
import copy
s = input()
N = int(s, 2)
res = 0
T = 1
while T < N:
	res += 1
	T *= 4
print(res)


x = int(input(), 2)
a = 0
while 4 ** a < x:
	a += 1
print(a)


s = int(input(), 2)
res = 0
i = 1
while i < s:
	res += 1
	i *= 4
print(res)


import sys
from collections import defaultdict as dc
from collections import Counter
from bisect import bisect_right
import math
n = input()
if n == '0':
	print(0)
elif n.count('1') == 1:
	print(math.ceil((len(n) - 1) / 2))
else:
	print(math.ceil(len(n) / 2))


s = input()
p = len(s)
s = tuple([int(x) for x in s])
sum = 0
for i in s[:]:
	sum = sum + i
	if sum == 2:
		break
if sum == 0:
	print(0)
elif p % 2 == 0:
	p = p // 2
	print(p)
elif p == 1:
	print(0)
elif sum == 2:
	p = p // 2 + 1
	print(p)
else:
	p = p // 2
	print(p)


s = input()
s = list(s)
x = s.count('1')
import math
if x == 1:
	a = (len(s) - 1) / 2
	print(int(math.ceil(a)))
elif x == 0:
	print('0')
else:
	print(int(math.ceil(len(s) / 2)))


n = input()
k = n.count('1')
m = len(n)
if k == 0:
	print('0')
elif k == 1:
	print(m // 2)
else:
	print((m + 1) // 2)


s = int(input(), 2)
(t, ans) = (1, 0)
while t < s:
	ans += 1
	t *= 4
print(ans)


import math
a = input()
k = 0
for i in range(0, len(a)):
	if a[i] == '1':
		k = k + pow(2, len(a) - i - 1)
p = 0
cnt = 0
while 4 ** p < k:
	p = p + 1
	cnt = cnt + 1
print(cnt)


n = input()
ans = len(n) // 2
n = int(n, 2)
if 1 << (ans << 1) < n:
	ans += 1
print(ans)


import math
s = input()
total = 0
l = len(s)
for i in range(l):
	if s[i] == '1':
		total += 2 ** (l - 1 - i)
if total < 2:
	print(0)
else:
	miss = 1
	i = 1
	while i * 4 < total:
		miss += 1
		i *= 4
	print(miss)


n = int(input(), 2)
l = [4 ** item for item in range(100)]
print(len([item for item in l if item < n]))


binary = input()

def binary_to_decimal(binary):
	return int(binary, 2)

def powers_four(num):
	powers = 0
	while num > 0:
		num = num // 4
		powers += 1
	return powers
dec = binary_to_decimal(binary)
print(powers_four(dec - 1))


s = input()
print(len(s) + ('1' in s[1:]) >> 1)


s = int(input(), 2)
for i in range(55):
	if 4 ** i >= s:
		print(i)
		break


n = input()
s = len(n)
if s == 1:
	print(0)
elif s % 2 == 0:
	print(s // 2)
elif int(n[1:]) == 0:
	print(s // 2)
else:
	print(s // 2 + 1)


s = int(input(), 2)
(i, j, a) = (0, 0, 0)
while True:
	a = 4 ** i
	if a >= s:
		break
	j = j + 1
	i = i + 1
print(j)


a = input()
if a[1:] != '0' * (len(a) - 1) and len(a) % 2 == 1:
	print((len(a) + 1) // 2)
else:
	print(len(a) // 2)


s = input()
l = len(s)
c = 0
if l == 1:
	print(0)
else:
	for i in range(l):
		if s[i] == '1':
			c = c + 1
	if c == 1:
		if l % 2 == 0:
			print(l // 2)
		else:
			print((l - 1) // 2)
	elif l % 2 == 0:
		print(l // 2)
	else:
		print(l // 2 + 1)


k = input()
n = int(k, base=2)
pw = 0
x = 0
r = 1
while r < n:
	x += 1
	r *= 4
print(x)


s = input()
n = int(s, 2)
j = 0
while 4 ** j < n:
	j += 1
print(j)


s = input()
k = len(s) - 1
ans = 0
for i in range(0, len(s)):
	ans = ans + int(s[i]) * pow(2, k)
	k = k - 1
sum = 0
n = 0
while 1:
	if sum >= ans:
		break
	else:
		sum = pow(4, n)
		n = n + 1
if n == 0:
	print(0)
else:
	print(n - 1)


num = int(input(), 2)
i = 0
while 4 ** i < num:
	i += 1
print(i)


s = input()
if len(s) % 2 == 0:
	print(len(s) // 2)
elif len(s) == 1:
	print(0)
elif set(list(s[1:])) == {'0'}:
	print(len(s) // 2)
else:
	print(len(s) // 2 + 1)


s = input()
x = int(s, 2)
c = 1
ans = 0
while c < x:
	c = c * 4
	ans += 1
print(ans)


i = int('0b' + input(), 2)
import math
i1 = 0
j = 0
for x in range(1000):
	j = pow(4, x)
	if j < i:
		i1 += 1
	else:
		break
print(i1)


def solve(s):
	if len(s) == 0:
		return 0
	l = len(s)
	n = s.count('1')
	return (l + 1) // 2 if n > 1 else l // 2
s = input()
print(solve(s))


n = input()
m = int(n, 2)
k = 0
c = 1
while c < m:
	c *= 4
	k += 1
print(k)


import math
s = input()
if len(s) == 1:
	print(0)
else:
	ans = math.ceil(len(s) / 2)
	if s.count('1') == 1 and len(s) % 2 == 1:
		ans -= 1
	print(ans)


s = reversed(str(input()))
n = 0
b = 1
for c in s:
	if c == '1':
		n += b
	b *= 2
x = 1
ans = 0
while x < n:
	x = x * 4
	ans += 1
print(ans)


s = input()
x = len(s)
if x % 2 == 1:
	for i in range(1, x):
		if s[i] == '1':
			print(x // 2 + 1)
			exit()
print(x // 2)


x = int(input(), 2)
for i in range(0, 100):
	if 4 ** i >= x:
		print(i)
		break


n = str(input())
n = int(n, 2)
m = 0
i = 0
while m < n:
	m = 4 ** i
	i = i + 1
if i != 0:
	print(i - 1)
else:
	print(0)


import math
b = input()
l = len(b)
if b == '0' or b == '1':
	print('0')
elif l % 2 == 0:
	print(l // 2)
elif b.count('1') == 1:
	print(l // 2)
else:
	print(l // 2 + 1)


def train(a):
	if a == '0':
		return 0
	if len(a) % 2 == 0:
		return int(len(a) / 2)
	elif a.count('1') == 1:
		return int(len(a) / 2)
	else:
		return int(len(a) / 2) + 1
a = input()
print(train(a))


n = int(input(), 2)
for i in range(10000):
	if 4 ** i >= n:
		break
print(i)


def solution(s):
	ans = 0
	bs = int(s, 2)
	for i in range(0, 51):
		d = 2 ** (2 * i)
		if d < bs:
			ans += 1
		else:
			break
	return ans
s = input()
print(solution(s))


binary = input()
k = int(binary, 2)
ans = 0
c = 1
while c < k:
	ans = ans + 1
	c = c * 4
print(ans)


k = int(input(), 2)
i = 0
while 4 ** i < k:
	i = i + 1
print(i)


def binaryToDecimal(n):
	return int(n, 2)
s = input()
num = binaryToDecimal(s)
if num == 0 or num == 1:
	print(0)
else:
	sum = 0
	count = 0
	flag = 0
	tf = 0
	for i in range(0, num):
		sum = int(pow(4, i))
		count += 1
		if sum > num:
			flag = 1
			break
		elif sum == num:
			tf = 1
			print(count - 1)
			break
	if flag == 1:
		print(count - 1)
	elif tf == 0:
		print(count)


N = list(input())
l = len(N)
if l % 2 == 1 and N.count('1') > 1 or l % 2 == 0:
	print((l - 1) // 2 + 1)
else:
	print((l - 1) // 2)


s = input()
l = len(s)
k = s.count('1')
if l % 2 == 0:
	print(l // 2)
elif k > 1:
	print(l // 2 + 1)
else:
	print(l // 2)


n = input()
d = int(n, 2)
(c, i) = (0, 0)
q = 4 ** i
while d > q:
	c += 1
	i += 1
	q = 4 ** i
print(c)


t = input()
res = (len(t) + 1) // 2
if len(t) % 2 == 1 and t.count('1') == 1:
	res -= 1
if t == '0':
	res = 0
print(res)


data = int(input())
number = int(str(data), 2)
count = 0
is_ok = True
i = 0
while is_ok:
	if number <= 4 ** i:
		is_ok = False
	else:
		i += 1
		count += 1
print(count)


num = eval('0b' + input())
pow = 1
s = 0
while pow < num:
	s += 1
	pow *= 4
print(s)


s = input()
if s == '0':
	print('0')
else:
	n = 0
	a = len(s)
	for i in s:
		if i == '0':
			n += 1
	if a - 1 == n and n % 2 == 0:
		m = (a - 1) // 2
	else:
		m = (a - 1) // 2 + 1
	print(m)


n = int(input())
i = 1
ans = 0
while n > 0:
	if n % 2 == 1:
		ans += i
	i *= 2
	n = n // 10
k = 0
while 4 ** k < ans:
	k += 1
print(k)


n = int(input())
m = n
count = 0
while m > 0:
	count = count + 1
	m = m // 10
s = 0
for i in range(count):
	s = s + 2 ** i * (n % 10)
	n = n // 10
t = 0
for i in range(200):
	if 4 ** i < s:
		t = t + 1
print(t)


s1 = input()
s1 = s1[::-1]
s = 0
j = 1
for i in s1:
	s += int(i) * j
	j *= 2
j = 1
ans = 0
while j < s:
	ans += 1
	j *= 4
print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import gcd, ceil

def pre(s):
	n = len(s)
	pi = [0] * n
	for i in range(1, n):
		j = pi[i - 1]
		while j and s[i] != s[j]:
			j = pi[j - 1]
		if s[i] == s[j]:
			j += 1
		pi[i] = j
	return pi

def prod(a):
	ans = 1
	for each in a:
		ans = ans * each
	return ans

def lcm(a, b):
	return a * b // gcd(a, b)
from math import inf
from collections import deque

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
for _ in range(int(input()) if not True else 1):
	s = input()[::-1]
	if s == '0':
		print(0)
		continue
	f = False
	ans = 0
	for i in range(len(s) - 1, -1, -1):
		if s[i] == '1' and (not f):
			ans += i // 2
			f = True
			if i % 2:
				ans += 1
				break
		elif s[i] == '1' and f:
			ans += 1
			break
	print(ans)


s = input()
x = len(s)
if s == '0':
	print(0)
	exit()
ans = (x - 1) // 2 + 1
if s == '1' + '0' * (x - 1) and x % 2 == 1:
	ans -= 1
print(ans)


m = input()

def bint(n):
	a = 0
	k = 0
	for i in range(len(n) - 1, -1, -1):
		k += int(n[a]) * 2 ** i
		a += 1
	return k
p = bint(m)
z = []
o = 1
for i in range(p):
	if o >= p:
		break
	z.append(o)
	o *= 4
print(len(z))


bi = input()
n = int(bi, 2)
(i, count) = (0, 0)
while True:
	if 4 ** i < n:
		count += 1
	elif 4 ** i >= n:
		break
	i += 1
print(count)


from math import *
from collections import *

def getl(t=int):
	return [t(x) for x in input().split()]

def get(t=int):
	return t(input())
alphabet = [chr(x) for x in range(ord('a'), ord('z') + 1)]
s = input()
l = len(s)
ans = 0
if l == 1:
	ans = 0
elif l % 2 == 0:
	ans = l / 2
else:
	flag = 0
	for i in range(1, l):
		if s[i] == '1':
			flag = 1
			break
	if flag == 0:
		ans = l // 2
	else:
		ans = l // 2 + 1
print(int(ans))


s = int('0b' + input(), 2)
ans = 0
while True:
	t = 2 ** (2 * ans)
	if s > t:
		ans += 1
	else:
		break
print(ans)


b_num = list(input())
value = 0
for i in range(len(b_num)):
	digit = b_num.pop()
	if digit == '1':
		value = value + pow(2, i)
c = 0
l = []
r = []
for i in range(100):
	r.append(4 ** i)
for j in range(len(r)):
	if value > r[j]:
		c += 1
		l.append(r[j])
print(c)


s = int(input(), 2)
total = 0
number = 1
while number < s:
	number *= 4
	total += 1
print(total)


s = input()
num = int(0)
p = 0
for i in range(len(s) - 1, -1, -1):
	if s[i] == '1':
		num += pow(2, p)
	p += 1
num1 = int(0)
p = 0
while num > num1:
	num1 = pow(4, p)
	if num1 >= num:
		break
	p += 1
print(p)


from math import floor

def log2(s):
	return len(s) - 1
s = input()
if s == '0':
	print(0)
else:
	zeroesCount = 0
	powerOf4 = True
	for i in range(1, len(s)):
		if s[i] != '0':
			powerOf4 = False
			break
		else:
			zeroesCount += 1
	if zeroesCount % 2 != 0:
		powerOf4 = False
	if powerOf4:
		missedCount = floor(log2(s) * 0.5)
	else:
		missedCount = 1 + floor(log2(s) * 0.5)
	print(missedCount)


a = input()
print((len(a) + ('1' in a[1:])) // 2)


n = input()
t = int(n, 2)
x = 4
y = 0
cnt = 0
while x ** y < t:
	cnt = cnt + 1
	y = y + 1
print(cnt)


def gns():
	return list(map(int, input().split()))
s = input()
x = int(s)
if x == 0 or len(s) == 1:
	print(0)
	quit()
l = len(s)
a = (l + 1) // 2
if len(s) % 2 == 1 and int(s[1:]) == 0:
	a -= 1
print(a)


import re
x = input('')
m = re.compile('^1(0)*$')
n = m.search(x)
if x == '0':
	print(x)
elif not n == None:
	print(len(x) // 2)
else:
	print((len(x) + 1) // 2)


s = input()
decimal = int(s, 2)
times = []
count = -1
while True:
	count += 1
	times.append(4 ** count)
	if times[-1] >= decimal:
		break
print(len(times) - 1)


import math

def calc(x: int):
	return pow(4, x)

def main():
	lim: int = int(input().strip(), 2)
	ans: int = 0
	for i in range(math.floor(lim / 2)):
		if calc(i) < lim:
			ans += 1
		else:
			break
	print(ans)
main()


a = int(input(), 2)
b = 1
cnt = 0
while b < a:
	b *= 4
	cnt += 1
print(cnt)


n = input()
m = int(n, 2)
count = 0
i = 0
while True:
	m1 = pow(4, i)
	if m1 < m:
		count += 1
	else:
		break
	i += 1
print(count)


ll = lambda : list(map(int, input().split()))
testcases = 1
import math
for testcase in range(testcases):
	x = input()
	x = int(x, 2)
	ans = 0
	for i in range(51):
		temp = pow(4, i)
		if x > temp:
			ans += 1
		else:
			break
	print(ans)


binary = int(input())

def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal
i = 0
t = True
while t:
	n = 4 ** i
	i += 1
	if n >= binaryToDecimal(binary):
		t = False
print(i - 1)


def mx(n):
	p = 0
	i = 1
	while i < n:
		p += 1
		i *= 4
	return p
s = 0
p = 0
for i in input()[::-1]:
	s += int(i) * 2 ** p
	p += 1
print(mx(s))


import math
n = input()
if n == '0':
	print(0)
else:
	l = len(n)
	n = int(n, 2)
	if n & n - 1 == 0:
		print(math.ceil((l - 1) / 2))
	else:
		print(math.ceil(l / 2))


mod = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
s = int(input(), 2)
for i in range(102):
	if 4 ** i >= s:
		print(i)
		exit(0)


def main():
	num = list(input())
	flag = False
	for i in range(1, len(num)):
		if num[i] == '1':
			flag = True
			break
	k = len(num)
	if flag == False:
		k -= 1
	res = 0
	while k > 0:
		k -= 2
		res += 1
	print(res)
main()


n = input()
s = 0
for i in range(len(n)):
	s += int(n[-i - 1]) * 2 ** i
ans = 0
k = 1
while True:
	if s <= k:
		break
	ans += 1
	k *= 4
print(ans)


from math import floor
a = input()
if a.count('1') > 1:
	print(floor((len(a) + 1) / 2))
else:
	print(floor(len(a) / 2))


def main():
	s_bin = input()
	s = int(s_bin, base=2)
	i = 0
	counter = 0
	while True:
		last_departure = 4 ** i
		if last_departure < s:
			counter += 1
		else:
			break
		i += 1
	print(counter)
main()


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	s = si()
	p = 0
	n = 0
	for i in range(len(s) - 1, -1, -1):
		if s[i] == '1':
			n += 1 * 2 ** p
		p += 1
	for i in range(1000000):
		if 4 ** i >= n:
			print(i)
			break
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


s = input()
s = str(s)
s = s[::-1]
t = 1
number = 0
for i in range(0, len(s)):
	if s[i] is '1':
		number = number + t
	t = t * 2
t = 1
ret = 0
while number > t:
	ret = ret + 1
	t = t * 4
print(ret)


q = input()
w = 0
e = 1
for i in q[::-1]:
	w += int(i) * e
	e *= 2
ans = 0
a = 1
while w > a:
	ans += 1
	a *= 4
print(ans)


def func(s):
	k = 0
	ln = len(s) - 1
	for i in s:
		if int(i) == 1:
			k = k + 2 ** ln
		ln = ln - 1
	return k

def task(s):
	count = 0
	k = 0
	while 4 ** k < s:
		count = count + 1
		k = k + 1
	return count
s = input()
num = func(s)
print(task(num))


x = list(map(int, input()))
ans = 0
j = 0
for i in range(len(x)):
	p = x.pop()
	if p == 1:
		ans += p * 2 ** i
while True:
	if 4 ** j >= ans:
		break
	else:
		j += 1
print(j)


some = [1, 4, 16, 64, 256, 1024, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456, 1073741824, 4294967296, 17179869184, 68719476736, 274877906944, 1099511627776, 4398046511104, 17592186044416, 70368744177664, 281474976710656, 1125899906842624, 4503599627370496, 18014398509481984, 72057594037927936, 288230376151711744, 1152921504606846976, 4611686018427387904, 18446744073709551616, 73786976294838206464, 295147905179352825856, 1180591620717411303424, 4722366482869645213696, 18889465931478580854784, 75557863725914323419136, 302231454903657293676544, 1208925819614629174706176, 4835703278458516698824704, 19342813113834066795298816, 77371252455336267181195264, 309485009821345068724781056, 1237940039285380274899124224, 4951760157141521099596496896, 19807040628566084398385987584, 79228162514264337593543950336, 316912650057057350374175801344]
s = int(input(), 2)
res = 0
for i in some:
	if s > i:
		res += 1
print(res)


s = input()
n = len(s)
a = 0
ct = 1
for i in range(n):
	if s[n - i - 1] == '1':
		a += ct
	ct *= 2
ans = 0
ct = 1
while ct < a:
	ans += 1
	ct *= 4
print(ans)


n = int(input(), 2)
ans = 0
k = 1
while k < n:
	ans += 1
	if k == 1:
		k = 4
	else:
		k *= 4
print(ans)


def bit(n):
	s = ''
	while n != 0:
		s = str(n % 4) + s
		n = n // 4
	return s
n = input()
n = int(n, 2)
s = bit(n)
if n == 0:
	print(0)
elif len(s) == 1:
	if s[0] == '1':
		print(0)
	else:
		print(1)
elif s[0] == '1' and set(list(s[1:])) == {'0'}:
	print(len(s) - 1)
else:
	print(len(s))


import math

def getone(n, power):
	for i in range(1, len(num)):
		if n[i] == '1':
			return 1
	return power % 2
num = input()
power = len(num) - 1
ans = int(power / 2) + getone(num, power)
print(ans)


import math
y = input()
f = 0
y = list(y)
n = len(y)
if y.count('1') == 1 and n % 2 != 0:
	f = 1
elif y.count('1') == 1 and n % 2 == 0:
	f = 2
if f == 1:
	print(math.floor(n / 2))
elif f == 2:
	print(math.ceil((n - 1) / 2))
elif y[0] == '0':
	print('0')
else:
	print(math.ceil(n / 2))


import sys
import math
import bisect

def main():
	val = 0
	for c in input():
		if c == '1':
			val = val * 2 + 1
		else:
			val = val * 2
	ans = 0
	tmp = 1
	while tmp < val:
		ans += 1
		tmp <<= 2
	print(ans)
main()


num = input()
n = int(num, 2)
k = 0
while 4 ** k < n:
	k = k + 1
print(k)


s = input()
k = 0
sum1 = 0
for i in range(len(s) - 1, -1, -1):
	if s[i] == '1':
		sum1 = sum1 + 1 * 2 ** k
	k = k + 1
i = 1
cnt = 0
while i < sum1:
	cnt = cnt + 1
	i = i * 4
print(cnt)


time = int(input(), 2)
step = 0
while 4 ** step < time:
	step += 1
print(step)


a = input()
q = len(a)
if q % 2 == 0:
	print(q // 2)
elif a.count('1') > 1:
	print(q // 2 + 1)
else:
	print(q // 2)


s = input()
p = s.count('1')
l = len(s) - 1
m = l // 2
if p > 1:
	m = l // 2
else:
	m = (l - 1) // 2
print(m + 1)


import sys, math, queue
MOD = 998244353
sys.setrecursionlimit(1000000)
s = input()
ans = (len(s) + 1) // 2
if len(s) % 2 == 0:
	print(ans)
	exit()
if s == '1' + '0' * (len(s) - 1) or s == '0':
	ans -= 1
print(ans)


s = input()
s = s[::-1]
l = len(s)
num = 0
for i in range(l):
	num += int(s[i]) * 2 ** i
ans = 0
for i in range(52):
	if num > 4 ** i:
		ans += 1
print(ans)


n = int(input(), 2)
count = 0
for i in range(0, 50):
	c = 4 ** i
	if c < n:
		count += 1
	else:
		break
print(count)


s = input()
if s.count('1') > 1:
	ans = (len(s) + 1) // 2
elif (len(s) - 1) % 2 != 0:
	ans = (len(s) + 1) // 2
else:
	ans = (len(s) - 1) // 2
print(ans)


l = list(map(int, input()))
if len(l) == 1 and l[0] == 1:
	print(0)
else:
	l.reverse()
	ans = 0
	e = 0
	for t in l:
		ans += t * 2 ** e
		e += 1
	c = 0
	v = 0
	z = 0
	while 1:
		if z * 4 >= ans:
			break
		z = 4 ** v
		c += 1
		v += 1
	print(c)


a = input()
a = int(a, base=2)
ps = 1
su = 0
ans = 0
while ps < a:
	su += ps
	ans += 1
	ps *= 4
print(ans)


b = input()
n = int(b, 2)
(temp, c) = (1, 0)
while temp < n:
	c += 1
	temp *= 4
print(c)


s = input()
n = (len(s) - 1) / 2
if '1' in s[1:] or len(s) % 2 == 0:
	n += 1
print(int(n))


s = int(input(), 2)
trains = 0
while 4 ** trains < s:
	trains += 1
print(trains)


s = input()
ans = (len(s) - 1) // 2 + 1
if (len(s) - 1) % 2 == 0 and s.count('0') == len(s) - (s[0] == '1'):
	ans -= 1
print(ans)


s = ''
for i in range(200):
	if i % 2 == 0:
		s = '1' + s
	else:
		s = '0' + s
t = input()
count = 0
flag = 0
for i in range(len(t)):
	if t[i] == '1':
		count += 1
		if flag == 0:
			flag = len(t) - i
ans = 0
for i in range(200 - flag, 200):
	if s[i] == '1':
		ans += 1
if count == 1 and (flag - 1) % 2 == 0:
	ans -= 1
print(ans)


str = input()
val = 0
str = str[::-1]
cnt = 0
res = 0
for i in range(0, len(str)):
	if str[i] == '1':
		res += pow(2, cnt)
	cnt += 1
cur = 1
result = 0
while cur < res:
	result += 1
	cur *= 4
print(result)


n = input()
x = ''
for i in n:
	x = i + x
num = 0
arr = []
arr.append(1)
for i in range(1, 101):
	arr.append(arr[i - 1] * 2)
data = []
data.append(1)
for i in range(1, 51):
	data.append(data[i - 1] * 4)
for i in range(len(x)):
	if x[i] == '1':
		num = num + arr[i]
for i in range(51):
	if num <= data[i]:
		print(i)
		break


import math
n = input()
j = math.floor(len(n) / 2)
if len(n) % 2 == 1:
	for x in range(1, len(n)):
		pass
		if n[x] == '1':
			j = j + 1
			break
print(j)


s = int(input(), 2)
i = 1
ans = 0
for _ in range(100):
	if i < s:
		ans += 1
	i *= 4
print(ans)


n = int(input(), 2)
count = 0
i = 1
flag = True
for j in range(51):
	if i >= n:
		print(count)
		break
	i = i * 4
	count += 1


nn = int(input(), 2)
a = 0
while pow(4, a) < nn:
	a += 1
print(a)


import math
n = input()
ans = 0
base = 1
n = int(n, 2)
while n - base > 0:
	ans += 1
	base *= 4
print(ans)


s = input()
ls = len(s)
z = ''
if ls % 2 > 0:
	s = '0' + s
	ls += 1
for i in range(0, ls, 2):
	if s[i] + s[i + 1] == '01':
		z += '1'
	elif s[i] + s[i + 1] == '10':
		z += '2'
	elif s[i] + s[i + 1] == '11':
		z += '3'
	else:
		z += '0'
c = '1'
z = int(z)
k = 0
while int(c) < z:
	c += '0'
	k += 1
print(k)


def Binary(binary):
	binary1 = binary
	deci = 0
	i = 0
	n = 0
	while binary != 0:
		dec = binary % 10
		deci = deci + dec * 2 ** i
		binary = binary // 10
		i += 1
	return deci
a = input()
a = int(a)
a = Binary(a)
kk = 0
sum = 0
while 1:
	if 4 ** kk < a:
		sum += 1
		kk += 1
	else:
		break
print(sum)


s = input()
s = int(s, 2)
k = 0
i = 0
while k < s:
	k = pow(4, i)
	i += 1
if s == 0:
	print('0')
else:
	print(i - 1)


def bit_converter(bit, n):
	if n == len(bit) - 1:
		return 2 ** (len(bit) - 1)
	p = 2 ** n * int(bit[n]) + bit_converter(bit, n + 1)
	return p

def checker(bit):
	i = 0
	num = bit_converter(bit[::-1], 0)
	while True:
		p = 4 ** i
		if p >= num:
			return i
		i += 1
print(checker(input()))


from __future__ import division, print_function
from sys import stdin, stdout
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
import heapq
from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd
from fractions import Fraction

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

def fmi():
	return map(int, stdin.readline().split())

def fli():
	return list(fmi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def dfs(v, c):
	if visited[v]:
		if col[v] != c:
			print('-1')
			exit()
		return
	col[v] = c
	visited[v] = 1
	for i in graph[v]:
		dfs(i, c ^ 1)

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d.keys():
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = {}
	for i in range(n):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			s.add(i)
			n = n // i
	if n > 2:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)
s = si()
s = int(s, 2)
c = 0
x = 1
while x < s:
	c += 1
	x = x * 4
print(c)


n = input()
b = int(n, 2)
(i, c) = (1, 0)
while i < b:
	i *= 4
	c += 1
print(c)


n = input()
b = int(n, 2)
count = 0
i = 1
while i < b:
	i = i * 4
	count += 1
print(count)


import math
sqs = [4 ** x for x in range(0, 50 + 1)]
time = int(input(), base=2)
for x in range(0, 50 + 1):
	if sqs[x] >= time:
		print(x)
		break
exit(0)


ans = []
for i in range(0, 100):
	x = 4 ** i
	ans.append(int(bin(x)[2:]))
from bisect import bisect_left
s = int(input())
print(bisect_left(ans, s))


def binaryToDecimal(n):
	binary = n
	decimal = 0
	for digit in binary:
		decimal = decimal * 2 + int(digit)
	i = 0
	while 4 ** i < decimal:
		i += 1
	return i
print(binaryToDecimal(input()))


import sys
input = sys.stdin.readline
s = input().strip()
n = len(s)
if n == 1:
	print(0)
	exit(0)
ans = n // 2
if n % 2 == 1 and '1' in s[1:]:
	print(ans + 1)
else:
	print(ans)


import math
sum = 0
num = 0
l = []
list = input()
length = len(list)
for i in range(0, len(list)):
	num = int(list[i])
	l.append(num)
l.reverse()
for i in range(len(l)):
	if l[i] == 1:
		sum += 2 ** i
if sum == 0:
	print(0)
else:
	y = math.log(sum) / math.log(4)
	help = math.ceil(y)
	if 4 ** help >= sum:
		print(help)
	else:
		print(help + 1)


def binary_to_decimal(b):
	sum = 0
	for i in range(len(b)):
		sum += int(b[len(b) - (i + 1)]) * pow(2, i)
	return sum

def get_num_trains(b):
	t_min = binary_to_decimal(b)
	for i in range(100):
		if pow(4, i) >= t_min:
			return i
print(get_num_trains(input()))


a = int(input())
b = 1
p = 0
while b < a:
	b *= 100
	p += 1
print(p)


def main():
	s = input()
	res = (len(s) - 1) // 2 + 1
	if (len(s) - 1) % 2 == 0 and s == '1' + '0' * (len(s) - 1):
		res -= 1
	if s == '0':
		res = 0
	print(res)
main()


n = input()
nn = int(n, 2)
tmp = 1
ans = 0
while tmp < nn:
	ans += 1
	tmp *= 4
print(ans)


import sys
input = sys.stdin.readline

def getInt():
	return int(input())

def getVars():
	return map(int, input().split())

def getArr():
	return list(map(int, input().split()))

def getStr():
	return input().strip()
s = getStr()
s = '0b' + s
n = int(s, 2)
x = 1
res = 0
while x < n:
	res += 1
	x *= 4
print(res)


import math, sys
from collections import Counter, defaultdict
from sys import stdin, stdout
input = stdin.readline
lili = lambda : list(map(int, sys.stdin.readlines()))
li = lambda : list(map(int, input().split()))

def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal

def isPowerOfFour(n):
	if n == 0:
		return False
	while n != 1:
		if n % 4 != 0:
			return False
		n = n // 4
	return True
s = int(input())
a = binaryToDecimal(s)
p = 0
c = 1
while c < a:
	c = c * 4
	p = p + 1
print(p)


s = input()
k = int(s)
ans = 0
for i in range(0, k):
	c = 100 ** i
	if c < k:
		ans = ans + 1
	else:
		break
print(ans)


s = str(input())
s = s[::-1]
ss = 0
for i in range(len(s) - 1, -1, -1):
	ss = ss + int(s[i]) * pow(2, i)
k = 1
cnt = 0
while k < ss:
	cnt += 1
	k = k * 4
print(cnt)


from collections import *
import math
import sys
input = sys.stdin.readline
n = int(input(), 2)
tot = 0
count = 0
while 4 ** tot < n:
	count += 1
	tot += 1
print(count)


s = int(input(), 2)
t = 1
k = 0
while t < s:
	t *= 4
	k += 1
print(k)


a = int(input())
t = 1
ans = 0
while t < a:
	ans = ans + 1
	t = t * 100
print(ans)


from math import pow
s = int(input(), 2)
j = 0
e = pow(4, j)
while e < s:
	j += 1
	e = pow(4, j)
print(j)


s = input()
if s == '0':
	print(0)
elif int(s) - 10 ** (len(s) - 1) == 0:
	print(len(s) // 2)
elif len(s) % 2 == 0:
	print(len(s) // 2)
else:
	print(len(s) // 2 + 1)


s = input()
ans = len(s) - 1
k = 0
for i in s:
	k += int(i)
if k > 1:
	ans += 1
if ans % 2 != 0:
	ans += 1
print(ans // 2)


n = input()
n = int(n, 2)
i = 0
c = 0
while True:
	if 4 ** i >= n:
		break
	else:
		c += 1
		i += 1
print(c)


def run(s):
	if s == '0' or s == '1':
		return print(0)
	result = None
	if len(s) % 2 == 1:
		if s.count('1') == 1:
			result = (len(s) - 1) / 2
		else:
			result = (len(s) + 1) / 2
	else:
		result = len(s) / 2
	print(int(result))
s = input()
run(s)


inp = input()
s = int(inp, 2)
count = 0
k = 0
while pow(4, k) < s:
	count += 1
	k += 1
print(count)


a = input()
b = int(a, base=2)
y = 0
t = 1
while b > t:
	y += 1
	t = t * 4
print(y)


n = input()
k = 1
num = 0
for i in range(len(n) - 1, -1, -1):
	num = num + int(n[i]) * k
	k = k * 2
l = [1]
for i in range(51):
	l.append(l[len(l) - 1] * 4)
cnt = 0
for i in range(len(l)):
	if num > l[i]:
		cnt += 1
print(cnt)


n = input()
le = len(n)
cur = 0
val = 0
for i in range(le - 1, -1, -1):
	if n[i] == '1':
		val = val + 2 ** cur
	cur += 1
ans = 0
for i in range(0, 150):
	if 4 ** i < val:
		ans += 1
	else:
		break
print(ans)


s = input()
if len(s) % 2 == 1:
	if '1' in s[1:]:
		print(len(s) // 2 + 1)
	else:
		print(len(s) // 2)
else:
	print(len(s) // 2)


number = int(input(), 2)
x = 0
count = 0
if number == 1:
	print(0)
else:
	while x < number:
		count += 1
		x = 4 ** count
	print(count)


import math
ip = input()
num = int(ip, 2)
val = 1
count = 0
while val < num:
	count += 1
	val *= 4
print(count)


t = int(input())
numerao = int(str(t), 2)
cont = 0
potencia = 1
while numerao > potencia:
	cont = cont + 1
	potencia = potencia * 4
print(cont)


def ans(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal
count = 0
s = str(input())
k = ans(int(s))
sum = 1
i = 0
x = k
l = [1, 4, 16, 64, 256, 1024]
while i <= k // 2:
	sum = sum * 4
	count += 1
	if sum >= x:
		break
	i += 1
if s == '0' or s == '1':
	print(0)
else:
	print(count)


s = input()
print((len(s) + (s.count('1') > 1)) // 2)


s = int(input(), 2)
t = 1
cnt = int()
while t < s:
	t = t * 4
	cnt += 1
print(cnt)


def trains(s):
	x = int(s, 2)
	count = 1
	k = 1
	num = 1
	while True:
		num = 4 ** k
		if num >= x:
			break
		count += 1
		k += 1
	return count
s = input()
if s == '0' or s == '1':
	print(0)
else:
	print(trains(s))


import sys
input = sys.stdin.readline

def binaryToDecimal(n):
	return int(n, 2)
a = binaryToDecimal(input())
count = 0
for i in range(0, 100):
	if a > 4 ** i:
		count += 1
	else:
		break
print(count)


binary_string = input()
x = int(binary_string, 2)
i = 0
count = 0
while 4 ** i < x:
	count += 1
	i += 1
print(count)


yeet = int(input(), 2)
print(sum((1 for y in range(50) if 4 ** y < yeet)))


k = input()
su = (len(k) - 1) // 2
l = len(k)
for i in range(1, l):
	if k[i] == '1':
		su += 1
		break
if len(k) % 2 == 0:
	su = len(k) // 2
print(su)


n = input()
d = int(n, 2)
count = 0
for i in range(0, 51):
	if d > 4 ** i:
		count += 1
print(count)


s = input()
m = len(s)
n = 0
j = 0
for i in range(m - 1, -1, -1):
	if s[i] == '1':
		n += 1 << j
	j += 1
cnt = 0
while pow(4, cnt) < n:
	cnt += 1
print(cnt)


from sys import stdin
input = stdin.readline
s = input()
n = len(s)
n -= 1
if n == 1:
	print('0')
	exit()
if s.count('0') == n - 1 and n % 2 != 0:
	print((n - 1) // 2)
elif n % 2 != 0 and s.count('0') != n - 1:
	print((n + 1) // 2)
else:
	print(n // 2)


sre = input()
xre = 0
yre = 1
for i in reversed(sre):
	if i == '1':
		xre += yre
	yre *= 2
xre = xre - 1
dvjcbvjc = 0
while xre > 0:
	xre = xre // 4
	dvjcbvjc += 1
print(dvjcbvjc)


string = input()
x = len(string) - 1
f = 0
sum = 0
while x >= 0:
	sum += 2 ** f * int(string[x])
	f += 1
	x -= 1
f = 0
g = 0
check = 0
while True:
	if 4 ** f < sum:
		g = 4 ** f
		f += 1
		check += 1
	else:
		break
print(check)


n = input()
if n == '0':
	print(0)
else:
	f = 0
	for c in n:
		if c == '1':
			f += 1
	if f > 1:
		print((len(n) + 1) // 2)
	else:
		print(len(n) // 2)


x = input()
n = int(x, 2)
count = 0
while True:
	if 4 ** count >= n:
		print(count)
		break
	count += 1


from math import log, ceil
s = int(input(), 2)
k = 0
while 4 ** k < s:
	k += 1
print(k)


import math
s = input()
n = len(s)
if s == '0':
	print(0)
	exit(0)
if s.count('1') == 1:
	print(math.ceil((n - 1) / 2))
else:
	print(math.ceil(n / 2))


st = input()
i = len(st) - 1
time = 0
for val in st:
	if val == '1':
		time = time + pow(2, i)
	i = i - 1
cnt = 0
while cnt <= 100:
	if pow(4, cnt) < time:
		cnt = cnt + 1
	else:
		break
print(cnt)


s = input()
j = len(s) - 1
if s == '0':
	print(0)
else:
	k = '1' + '0' * j
	if s == k:
		print((j + 1) // 2)
	else:
		print(j // 2 + 1)


s = input()
n = int(s, 2)
c = 0
n = n - 1
while n >= 1:
	c = c + 1
	n = n // 4
print(c)


from math import log, ceil

def solve1():
	S_string = input()
	S = int(S_string, 2)
	if S <= 1:
		print(0)
		return
	x = int(ceil(log(S, 4)))
	print(x)

def solve2():
	S_string = input()
	S = int(S_string, 2)
	if S_string.count('1') == 1:
		print(ceil(log(S, 4)))
	else:
		print(ceil(log(S, 4)))

def solve3():
	S_string = input()
	if S_string == '0' or S_string == '1':
		print(0)
		return
	if S_string.count('1') == 1:
		print(ceil((len(S_string) - 1) / 2))
	else:
		print(ceil(len(S_string) / 2))

def main():
	solve3()
main()


s = input()
if s == '0':
	print(0)
else:
	t = 0
	for i in s:
		t += int(i)
	if t == 1 and len(s) % 2 == 1:
		print((len(s) - 1) // 2)
	else:
		print(1 + (len(s) - 1) // 2)


s = str(input())
p = len(s)
c = 0
for i in s:
	if i == '1':
		c += 1
if s == '0':
	print(0)
elif c == 1:
	print(p // 2)
elif p % 2 != 0:
	print(p // 2 + 1)
else:
	print(p // 2)


s = input()
n = len(s)
if s == '0':
	print(0)
	exit(0)
if s[0] == '1' and s.count('0') == n - 1:
	print(n // 2)
else:
	print((n + 1) // 2)


n = input()
a = int(n, 2)
i = 0
count = 0
while 1:
	if 2 ** i >= a:
		break
	else:
		count = count + 1
	i = i + 2
print(count)


s = str(input())
if len(s) <= 1:
	print(0)
	exit(0)
if len(s) % 2 == 0:
	print(len(s) // 2)
else:
	temp_ans = (len(s) + 1) // 2
	extra_one_present = False
	for i in range(1, len(s)):
		if s[i] == '1':
			extra_one_present = True
	if not extra_one_present:
		temp_ans -= 1
	print(temp_ans)


import math
st = input()
l = len(st)
count = st.count('1')
if st == '0':
	print(0)
elif count == 1:
	print(int(math.ceil((l - 1) / 2)))
else:
	print(int(math.ceil(l / 2)))


s = input()
n = len(s)
N = 0
t = 1
for i in range(n - 1, -1, -1):
	N += t * int(s[i])
	t = t * 2
ans = 0
t = 1
while t < N:
	ans += 1
	t *= 4
print(ans)


def binaryToDecimal(n):
	return int(n, 2)
k = 0
s = input()
s_dec = binaryToDecimal(s)
while 4 ** k < s_dec:
	k = k + 1
print(k)


n = int(input(), 2)
x = 1
cnt = 0
while 1:
	if x >= n:
		break
	cnt += 1
	x <<= 2
print(cnt)


n = input()
m = int(n, 2)
c = 0
i = 1
while i < m:
	i = i * 4
	c = c + 1
print(c)


a = int(input())
x = a
s = 0
k = 0
while x > 0:
	z = x % 10
	if z == 1:
		s += 2 ** k
	k += 1
	x = x // 10
count = 0
c = 0
i = 1
while i < s:
	count += 1
	c += 1
	i = 4 ** c
print(count)


n = input()
k = int(n, 2)
cnt = 0
for i in range(k):
	a = 4 ** i
	if a < k:
		cnt += 1
	else:
		break
print(cnt)


def binaryToDecimal(n):
	return int(n, 2)
s = input()
s1 = binaryToDecimal(s)
i = 1
sum = 0
while i < s1:
	sum = sum + 1
	i = i * 4
print(sum)


import math
time = int(input(), 2)
count = 0
number = pow(4, count)
while number < time:
	count += 1
	number = pow(4, count)
print(count)


s = input()
(n, sm) = (len(s), sum((int(i) for i in s)))
print(n // 2 + (1 if sm > 1 and n % 2 == 1 else 0))


import math
s = input()
num = 0
s = s[::-1]
for x in range(len(s)):
	if s[x] == '1':
		num += 2 ** x
lis = []
count = 0
for x in range(51):
	lis.append(4 ** x)
for x in lis:
	if x < num:
		count += 1
	else:
		break
print(count)


s = int(input(), 2)
i = 0
while True:
	power4 = 4 ** i
	if power4 >= s:
		break
	i += 1
print(i)


string = input()
n = int(string, 2)
cont = 0
r = 1
while r < n:
	r = r * 4
	cont = cont + 1
print(cont)


num = input()
b = int('0b' + num, 2) - 1
count = 0
while b > 0:
	b = b // 4
	count += 1
print(count)


def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	x = decimal
	k = 0
	count = 0
	while 4 ** k < x:
		k += 1
		count += 1
	print(count)
n = int(input())
binaryToDecimal(n)


binary_string = input()
j = 0
ans = 0
for i in binary_string[::-1]:
	ans += int(i) * 2 ** j
	j += 1
total = 0
i = 0
while 4 ** i < ans:
	i += 1
	total += 1
print(total)


s = int(input(), 2)
train = 1
counter = 0
while train < s:
	counter += 1
	train *= 4
print(counter)


s = input()

def hantei(s, t):
	if s == t:
		return False
	elif len(s) > len(t):
		return True
	elif len(s) < len(t):
		return False
	else:
		for k in range(len(s)):
			if s[-k - 1] == 1 and t[-k - 1] == 0:
				return True
			elif s[-k - 1] == 0 and t[-k - 1] == 1:
				return False
if s == '0':
	print(0)
	exit(0)
S = ['1' + '00' * k for k in range(100)]
for k in range(100):
	if hantei(s, S[k]) == False:
		print(k)
		exit(0)


n = input()
s = len(n)
if s % 2 == 0:
	print(int(s / 2))
else:
	ans = int(s / 2)
	for i in n[1:]:
		if i == '1':
			ans += 1
			break
	print(int(ans))


s_1 = input()
s_2 = '1' + '0' * (len(s_1) - 1)
if s_1 > s_2 and len(s_1) % 2 == 1:
	print(len(s_1) // 2 + 1)
else:
	print(len(s_1) // 2)


s = input()
res = 0
for a in s:
	res *= 2
	res += int(a)
ans = 0
now = 1
while now < res:
	now *= 4
	ans += 1
print(ans)


i = input()
if i.count('1') > 1:
	print(int((len(i) + 1) / 2))
else:
	print(int(len(i) / 2))


s = input()
x = 0
if s.count('1') <= 1 and len(s) % 2:
	x = 1
print((len(s) + 1) // 2 - x)


import math
n = int(input(), 2)
flag = 1
j = 0
while flag == 1:
	no = math.pow(4, j)
	if no >= n:
		break
	j += 1
print(j)


import math
ans = int(input(), 2)
f = 1
c = 0
while f < ans:
	c += 1
	f *= 4
print(c)


s = list(input())
a = 0
b = 0
for i in range(len(s)):
	a = a + int(s[i]) * pow(2, len(s) - i - 1)
for i in range(pow(2, 100)):
	if pow(4, i) < a:
		b += 1
	else:
		break
print(b)


n = int(input(), 2)
base = 1
train = 0
while base < n:
	train += 1
	base *= 4
print(train)


a = int(input())
i = 1
s = 0
while a // 10 != 0 or a % 10 != 0:
	s += a % 10 * i
	i = i * 2
	a = a // 10
t = 0
d = 1
while s > d:
	d = d * 4
	t += 1
print(t)


inp = input()
n = len(inp) // 2
flag = 0
for i in inp[1:]:
	if i != '0':
		flag = 1
		break
print(n + flag if len(inp) % 2 else n)


def main():
	time = input()
	length = len(time)
	if time.count('1') > 1:
		trains = (length + 1) // 2
	else:
		trains = length // 2
	print(trains)
main()


s = input()
ans = 0
for i in range(1, 100, 2):
	if len(s) > i:
		ans += 1
	if len(s) == i and sum(map(int, list(s))) > 1:
		ans += 1
print(ans)


l = []
passed = 0
for i in range(51):
	l.append(4 ** i)
b = int(input(), 2)
for i in l:
	if i < b:
		passed += 1
print(passed)


a = int(input())
n = 0
c = 1
l = 0
while c * 10 < a:
	c = c * 10
	l += 1
if a > 1:
	print((l + 2) // 2)
else:
	print(0)


s = input()
b = 0
for f in range(len(s) - 1):
	if s[f + 1] != '0':
		b = 1
if b == 0:
	print(int(len(s) / 2))
else:
	print(int((len(s) + 1) / 2))


s = str(input())
n = int(s, 2)
if n < 2:
	print(0)
else:
	c = 0
	n = n - 1
	while n:
		c += 1
		n = n // 4
	print(c)


s = input()
nO = sum([1 for d in s if d == '1'])
n = len(s)
if nO == 0:
	print(0)
	exit(0)
elif nO == 1:
	n -= 1
print((n + 1) // 2)


n = int(input(), 2)
res = sum((1 for x in range(50) if 4 ** x < n))
print(res)


n = input()
if len(n) == 1:
	print(0)
else:
	ans = (len(n) + 1) // 2
	if n.count('1') == 1 and len(n) % 2 == 1:
		ans -= 1
	print(ans)


binary = input()
decimal = 0
for digit in binary:
	decimal = decimal * 2 + int(digit)
for i in range(0, 100):
	if 4 ** i >= decimal:
		print(i)
		break


for _ in range(1):
	a = input()
	s = int(a, 2)
	d = 0
	k = 1
	while k < s:
		k = k * 4
		d = d + 1
	print(d)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(beauty, s, n, count):
	pass
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
alphs = 'abcdefghijklmnopqrstuvwxyz'
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect

def solve():
	s = string()
	ans = 0
	c = 0
	for i in range(100):
		val = 4 ** i
		if int(bin(val)[2:]) >= int(s):
			break
		c += 1
	print(c)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for i in range(1):
	solve()


import math
a = input()
n = len(a)
c = 0
for (i, val) in enumerate(a):
	if val == '1':
		c += 1
if c == 0:
	print(0)
else:
	print(math.ceil(n / 2 - 1 / 2) if c == 1 else math.ceil(n / 2))


s = int(input(), 2)

def solve(s):
	if s == 0:
		return 0
	import math
	t = int(math.log(s, 4))
	if 4 ** t >= s:
		t -= 1
	return t + 1
print(solve(s))


horario = input()
horario = int(horario, 2)
if horario == 0:
	print(horario)
else:
	i = 0
	while True:
		trem = 4 ** i
		if trem >= horario:
			print(i)
			break
		i += 1


import math
s = input()
count = 0
for i in s:
	if i == '1':
		count += 1
n = len(s)
if count == 1:
	n -= 1
if s == '0':
	print(0)
else:
	print(math.ceil(n / 2))


import math
import sys
strr = sys.stdin.readline()
num = int(strr, 2)
i = 0
while pow(4, i) < num:
	i += 1
print(i)


a = input()
inta = int(a, 2)
count = 0
for i in range(inta):
	if 4 ** i < inta:
		count += 1
	else:
		break
print(count)


a = input()
b = int(a, 2)
s = 1
n = 0
k = 4
while s < b:
	s = s * k
	n += 1
print(n)


b = input()
sum = 0
for i in range(len(b)):
	sum += int(b[len(b) - 1 - i]) * pow(2, i)
j = 0
k = 1
while sum > k:
	k = k * 4
	j = j + 1
print(j)


n = input()
n = '0b' + n
n = int(n, 2)
x = 0
while 4 ** x < n:
	x = x + 1
print(x)


s = input()
r = len(s) // 2
if s.count('1') > 1 and len(s) % 2 == 1:
	r += 1
print(r)


k = int(input(), 2)
c = 0
while 4 ** c < k:
	c += 1
print(c)


n = [i for i in input()]
s = 0
res = len(n) // 2
if n.count('1') > 1 and len(n) % 2 != 0:
	res += 1
print(res)


read = lambda : [int(i) for i in input().split()]
s = input()
p = len(s) // 2
if len(s) % 2 == 1:
	cnt = 0
	for c in s:
		if c == '1':
			cnt += 1
	if cnt > 1:
		p += 1
print(p)


import math
n = [int(x) for x in list(input())]
m = len(n)
k = 0
for i in range(m):
	k += 2 ** i * n[-i - 1]
i = 0
while 1:
	if 4 ** i >= k:
		print(i)
		break
	i += 1


n = int(input())
p = len(str(n))
l = list(map(int, str(n)))
c = 0
for i in range(p):
	c += l[i] * pow(2, p - 1 - i)
j = 1
i = 1
while j < c:
	j = pow(4, i)
	i += 1
print(i - 1)


import math
s = input()
n = len(s) - 1
res = n // 2 + 1
flag = 0
for i in range(1, len(s)):
	if s[i] == '1':
		flag = 1
		break
if flag == 0 and n % 2 == 0:
	res -= 1
print(res)


s = input()
if s.count('1') > 1:
	print((len(s) - 1) // 2 + 1)
else:
	print(len(s) // 2)


n = input()
n = ''.join(n)
val = int(n, 2)
answer = 0
while 6 == 6:
	if pow(4, answer) < val:
		answer += 1
	else:
		break
print(answer)


n = int(input(), 2)
res = 0
p = 1
while p < n:
	res += 1
	p <<= 2
print(res)


s = input()
if s == '0':
	print(0)
else:
	print((len(s) + 1) // 2 - (s.count('1') == 1 and len(s) % 2 == 1))


s = str(input())
s = s[::-1]
k = 0
p = 1
cnt = 0
for i in range(len(s)):
	if s[i] == '1':
		k = k + 2 ** i
while True:
	if p >= k:
		break
	else:
		cnt = cnt + 1
		p = p * 4
print(cnt)


string = input()
if string != '0':
	cont = 0
	for c in string:
		cont += c == '0'
	if cont == len(string) - 1:
		print(len(string) // 2)
	else:
		print((len(string) + 1) // 2)
else:
	print('0')


import math
s = input()
if s == '0':
	print('0')
else:
	powof4 = int(math.ceil(len(s) / 2))
	s1 = '1' + (len(s) - 1) * '0'
	if s1 == s and len(s) % 2 != 0:
		print(powof4 - 1)
	else:
		print(powof4)


a = str(input())
z = 1
b = 0
s = len(a)
for i in range(s - 1, -1, -1):
	b = b + int(a[i]) * z
	z = z * 2
j = 1
an = 0
while j < b:
	j = j * 4
	an = an + 1
print(an)


import math
s = input()
n = len(s)
k = 0
c = 0
for i in range(n - 1, -1, -1):
	if s[i] == '1':
		k += 1
	if i % 2 == (n - 1) % 2:
		c += 1
if k <= 1 and (n - 1) % 2 == 0:
	c -= 1
print(c)


from math import sqrt, ceil

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def si():
	return input()
s = si()
n = len(s)
s1 = 0
i = 0
while n:
	s1 += int(s[n - 1]) * 2 ** i
	n -= 1
	i += 1
k = 1
i = 0
c = 0
while 1:
	if k >= s1:
		break
	c += 1
	i += 1
	k = 4 ** i
print(c)


binary_str = input()
decimal = int(binary_str, 2)
k = 0
while 4 ** k < decimal:
	k = k + 1
print(k)


a = input()
b = int(a, 2)
(res, k) = (1, 0)
while b > res:
	res *= 4
	k += 1
print(k)


n = [input()]
l = list(map(int, str(n[0])))
j = len(l)
power = 0
decimal = 0
if n[0] == '0':
	print(0)
else:
	for i in range(j):
		decimal += pow(2, i) * l[j - i - 1]
	i = 0
	while power < decimal:
		power = pow(4, i)
		i = i + 1
	print(i - 1)


import math
s = input()
n = int(s, 2)
i = 0
for i in range(0, n, 1):
	if math.pow(4, i) >= n:
		break
print(i)


some = [1, 4, 16, 64, 256, 1024, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456, 1073741824, 4294967296, 17179869184, 68719476736, 274877906944, 1099511627776, 4398046511104, 17592186044416, 70368744177664, 281474976710656, 1125899906842624, 4503599627370496, 18014398509481984, 72057594037927936, 288230376151711744, 1152921504606846976, 4611686018427387904, 18446744073709551616, 73786976294838206464, 295147905179352825856, 1180591620717411303424, 4722366482869645213696, 18889465931478580854784, 75557863725914323419136, 302231454903657293676544, 1208925819614629174706176, 4835703278458516698824704, 19342813113834066795298816, 77371252455336267181195264, 309485009821345068724781056, 1237940039285380274899124224, 4951760157141521099596496896, 19807040628566084398385987584, 79228162514264337593543950336, 316912650057057350374175801344]

def bin_search(need):
	left = -1
	right = len(some)
	while right > left + 1:
		mid = (left + right) // 2
		if some[mid] >= need:
			right = mid
		else:
			left = mid
	return left + 1
s = int(input(), 2)
res = 0
print(bin_search(s))


s = input()
c = 0
g = int(s, 2)
a = 1
while a < g:
	a *= 4
	c += 1
print(c)


k = input().strip()
n = 0
k = k[::-1]
for i in range(0, len(k)):
	n += 2 ** i * int(k[i])
res = 0
count = 0
while True:
	if 4 ** count >= n:
		print(count)
		break
	count += 1


n = input()
length = len(n)
if n == '0':
	print(0)
elif length % 2 == 0:
	print(int((length - 1) / 2) + 1)
else:
	l = int(length / 2)
	if n.count('1') == 1:
		l -= 1
	print(l + 1)


s = input()
if len(s) % 2 == 0:
	print(len(s) // 2)
elif '1' in s[1:]:
	print((len(s) + 1) // 2)
else:
	print((len(s) - 1) // 2)


def mp():
	return map(int, input().split())
n = int(input(), 2)
ans = 0
i = 1
while i < n:
	i *= 4
	ans += 1
print(ans)


n = input()
a = []
for i in n:
	a.append(int(i))
a.reverse()
sum1 = 0
for i in range(len(n)):
	sum1 = sum1 + a[i] * 2 ** i
i = 1
cin = 0
while i < sum1:
	cin = cin + 1
	i = i * 4
print(cin)


x = int(input(), 2)
i = 1
c = 0
while i < x:
	i *= 4
	c += 1
print(c)


S = input()
L = len(S)
if L % 2 == 0:
	print(L // 2)
else:
	count1 = 0
	for i in S:
		if i == '1':
			count1 += 1
	if count1 >= 2:
		print(L // 2 + 1)
	else:
		print(L // 2)


import math
n = input()
if n == '0':
	print('0')
else:
	n1 = int(n, 2)
	c = math.log(n1, 4)
	if int(c) == c:
		if 4 ** int(c) < n1:
			print(int(c) + 1)
		else:
			print(int(c))
	else:
		print(math.ceil(c))


s = input()
s = int(s, 2)
for i in range(0, 101):
	if 4 ** i < s:
		continue
	else:
		print(i)
		break


n = int(input(), 2)
p = 1
count = 0
while p < n:
	p *= 4
	count += 1
print(count)


s = input()
ans = 0
l = len(s)
if s == 0:
	print(0)
	exit()
if len(s) % 2 == 0:
	ans = l // 2
elif '1' in s[1:len(s)]:
	ans = (l + 1) // 2
else:
	ans = l // 2
print(ans)


import sys
import math

def main(arr):
	if arr == '0':
		return 0
	ones = arr.count('1')
	zeros = arr.count('0')
	if ones == 1 and zeros % 2 == 0:
		return math.ceil(len(arr) / 2) - 1
	else:
		return math.ceil(len(arr) / 2)
arr = []
for (e, line) in enumerate(sys.stdin.readlines()):
	if e == 0:
		arr = line.strip()
	arr = line.strip()
print(main(arr))


s = input()
s = int(s, 2)
c = i = 0
while 2 ** i < s:
	c = c + 1
	i = i + 2
print(c)


def multip(num):
	count = 0
	mult = 1
	while mult < num:
		mult *= 4
		count += 1
	print(count)
num = int(input(), 2)
multip(num)


import math
a = int(input(), 2)
k = 0
x = 0
while 4 ** x < a:
	x += 1
	k += 1
print(k)


a = input()
a1 = int(a, 2)
i = 1
c = 0
while i < a1:
	i = i * 4
	c = c + 1
print(c)


n = int(input(), 2)
t = 1
ans = 0
for i in range(101):
	if t < n:
		ans += 1
	t *= 4
print(ans)


n = str(input())
p = len(n) - 1
x = ans = 0
c = 1
for i in n:
	if i == '1':
		x += 1 << p
	p -= 1
while x > c:
	ans += 1
	c *= 4
print(ans)


x = int(input(), 2)
i = 0
m = 0
while True:
	m = 4 ** i
	i = i + 1
	if m >= x:
		print(i - 1)
		break


from sys import stdin
from sys import setrecursionlimit as SRL
SRL(10 ** 7)
rd = stdin.readline
rrd = lambda : map(int, rd().strip().split())
s = str(rd().strip())
s = s[::-1]
bg = 0
for i in s[:len(s) - 1]:
	if i == '1':
		bg = 1
		break
ans = len(s) // 2 + bg if len(s) % 2 else len(s) // 2
print(ans)


def fun(n):
	j = 0
	tmep = []
	while True:
		t = 2 ** j
		if t >= n:
			pass
		else:
			tmep.append(t)
		j += 2
		if t >= n:
			break
	return len(tmep)
print(fun(int(input(), 2)))


def method():
	n = input()
	s = int(n, 2)
	k = 0
	count = 0
	while 4 ** k < s:
		count += 1
		k += 1
	print(count)
method()


import math

def biExchange(biStr):
	biList = list(biStr)
	biList.reverse()
	deNum = 0
	for k in range(0, len(biStr)):
		deNum = deNum + int(biList[k]) * 2 ** k
	return deNum
s = input()
deNum = biExchange(s)
i = 0
while True:
	if 4 ** i < deNum:
		i += 1
	else:
		print(i)
		break


a = input()
n = len(a)
ans = int(n / 2)
if n % 2 != 0:
	for i in range(1, n):
		if a[i] == '1':
			print(ans + 1)
			break
	else:
		print(ans)
else:
	print(ans)


n = int(input())
n = int(str(n), 2)
ans = 0
for i in range(0, 101, 1):
	val = int(pow(4, i))
	if n <= val:
		break
	else:
		ans += 1
print(ans)


num = int(input(), 2)
base = 1
ans = 0
while num > base:
	ans += 1
	base *= 4
print(ans)


s = input()[::-1]
n = 0
x = 1
for i in range(len(s)):
	if s[i] == '1':
		n += x
	x *= 2
ans = 0
x = 1
while x < n:
	ans += 1
	x *= 4
print(ans)


def binaryToDecimal(n):
	return int(n, 2)
count = 0
val2 = str(input())
val = binaryToDecimal(val2)
cop = val
i = 0
g = 1
while 1:
	if g >= val:
		break
	count = count + 1
	g = g * 4
print(count)


n = int(input(), 2)
temp = 0
l = []
while 4 ** temp < n:
	l.append(4 ** temp)
	temp += 1
print(len(l))


n = int(input(), 2)
arr = [0] * 51
for i in range(51):
	arr[i] = 2 ** (2 * i)
for i in range(51):
	if n <= arr[i]:
		print(i)
		break


s = input()
k = 0
n = int(s, 2)
while True:
	if 4 ** k < n:
		k += 1
	else:
		break
print(k)


s = int(input())
inputA = int(str(s), 2)
aux = 0
pot = 1
while inputA > pot:
	aux = aux + 1
	pot = pot * 4
print(aux)


s = input()
b = int(s, 2)
p = -1
i = 0
while p < b:
	p = 4 ** i
	i += 1
print(i - 1)


p = []
p4 = []
p.append(1)
p4.append(1)
j = 1
ans = 0
while j <= 1005:
	p.append(p[j - 1] * 2)
	p4.append(p4[j - 1] * 4)
	j += 1
t = input()
s = t[::-1]
n = 0
for i in range(len(s)):
	if s[i] == '1':
		n += p[i]
for i in range(100):
	if n > p4[i]:
		ans += 1
print(ans)


s = input()
flag = 1
for i in range(1, len(s)):
	if s[i] != '0':
		flag = 0
if not flag and len(s) % 2:
	print((len(s) - 2) // 2 + 2)
else:
	print((len(s) - 2) // 2 + 1)


time = input()
if len(time) % 2 == 0:
	print(int(len(time) / 2))
elif '1' in time[1:]:
	print(int((len(time) + 1) / 2))
else:
	print(int(len(time) / 2))


import math
a = input()
j = 0
m = 0
c = 0
o = 0
for i in a[::-1]:
	p = math.pow(2, j)
	s = int(p) * int(i)
	s = s + m
	m = s
	j = j + 1
while o < m:
	o = math.pow(4, c)
	c = c + 1
if c == 0:
	print(0)
else:
	print(c - 1)


lst = []
a = 0
i = 0
while True:
	a = 4 ** i
	if a >= 2 ** 101:
		break
	lst.append(a)
	i += 1
inp = input()
inp = int(inp, 2)
p = 0
for i in lst:
	p += 1
	if i >= inp:
		break
p -= 1
print(p)


import math
I = lambda : int(input())
ID = lambda : map(int, input().split())
IL = lambda : list(ID())
s = int(input(), 2)
p = 0
while 4 ** p < s:
	p += 1
print(p)


s = int(input(), 2)
ss = 0
while 4 ** ss < s:
	ss += 1
print(ss)


s = input()
dec = int(s, 2)
temp = 1
res = 0
while 1:
	if temp < dec:
		res += 1
	else:
		break
	temp *= 4
print(res)


s = input()
count = int(s, 2)
k = 0
while 4 ** k < count:
	k = k + 1
print(k)


import math
s = input()
n = int(s, 2)
N = n
c = 0

def isPower(x, y):
	if x == 1:
		return y == 1
	pow = 1
	while pow < y:
		pow = pow * x
	return pow == y
while 1:
	n = n // 4
	c += 1
	if n == 0:
		break
if isPower(4, N) or N == 0:
	print(c - 1)
else:
	print(c)


import sys, math
n = sys.stdin.readline().rstrip()
n = int(n, base=2)
ans = 0
for i in range(1000):
	if pow(4, i) < n:
		ans += 1
	else:
		break
print(ans)


n = int(input(), 2)
ans = 0
bus_time = 0
i = 0
while True:
	bus_time = 4 ** i
	if bus_time >= n:
		break
	ans += 1
	i += 1
print(ans)


import sys
l = sys.stdin.readline().rstrip()
ln = len(l)
oCnt = l.count('1')
if ln % 2 == 1:
	print(ln // 2 + 1 if oCnt > 1 else ln // 2)
else:
	print((ln - 1) // 2 + 1)


a = input()
number = 0
j = 0
for i in range(len(a) - 1, -1, -1):
	number = number + int(a[i]) * 2 ** j
	j += 1
j = 0
k = 0
count = 0
while 1:
	k = 4 ** j
	if k < number:
		count += 1
	else:
		break
	j += 1
print(count)


def solve(s):
	result = 0
	t = '1'
	while int(t) < int(s):
		t += '00'
		result += 1
	return result
s = input()
print(solve(s))


n = int(input(), 2)
(rs, tmp) = (0, 1)
while tmp < n:
	tmp *= 4
	rs += 1
print(rs)


import math
s = str(input())
(value, p) = (0, len(s) - 1)
for i in range(len(s)):
	if s[i] == '1':
		value += 1 << p
	p -= 1
(ans, p) = (0, 1)
while p < value:
	ans += 1
	p *= 4
print(ans)


n = int(input(), 2)
x = 1
k = 0
while x < n:
	k += 1
	x *= 4
print(k)


i = input()
l = len(i)
n = i.count('1')
ans = (l + 1) // 2
if l % 2 == 1 and n == 1:
	ans -= 1
if n == 0:
	ans = 0
print(ans)


n = input()
c = len(n)
if n[1:].find('1') != -1:
	c += 1
print(c // 2)


from math import log, ceil
n = input()
t = int(n, 2)
if t > 1:
	for i in range(50, -1, -1):
		if t > 4 ** i:
			print(i + 1)
			break
else:
	print(0)


n = input()
num = 0
c = len(n) - 1
for i in n:
	num += int(i) * 2 ** c
	c -= 1
if num <= 2 ** 100 and num > 0:
	a = 0
	i = 0
	while a < num:
		a = 4 ** i
		i += 1
	print(i - 1)
else:
	print(0)


from math import *
i = input()
s = 0
for i1 in range(len(i)):
	if i[i1] == '1':
		s = i1
		break
v = len(i) - s
if i.count('1') > 1:
	print(ceil(v / 2))
else:
	print(v // 2)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import math
n = int(input(), 2)
ans = 0
cv = 1
while n > cv:
	cv *= 4
	ans += 1
print(ans)


a = input()
a = int(a, 2)
if a == 0:
	print(0)
else:
	import math
	kk = math.log(a, 4)
	kk = int(kk)
	if 4 ** kk < a:
		a = int(kk) + 1
	else:
		a = int(kk)
	print(a)


def f():
	s = input()
	SIZE = len(s)
	count = 0
	for i in range(1, len(s)):
		if s[i] == '1':
			count = 1
			break
	if len(s) % 2 == 0:
		print(len(s) // 2)
	elif count == 1:
		print(len(s) // 2 + 1)
	else:
		print(len(s) // 2)
f()


s = int(input(), 2)
t = 1
c = 0
while s > t:
	c += 1
	t *= 4
print(c)


s = input()
a = int(s, 2)
i = 0
while pow(4, i) < a:
	i += 1
print(i)


import math
n = input()
x = int(n, 2)
c = 1
d = 0
while c < x:
	d += 1
	c = c * 4
print(d)


s = input()
if len(s) % 2 == 0 or len(s.split('1')) <= 2:
	print(int(len(s) / 2))
else:
	print(int(len(s) / 2) + 1)


num = input()
num = int(num, 2)
counter = 0
start = 1
while start < num:
	counter += 1
	start = start * 4
print(counter)


x = int(input(), 2)
ans = 0
for i in range(110):
	if 4 ** i >= x:
		ans = i
		break
print(ans)


a = input()
a = a[::-1]
total = 0
for i in range(len(a)):
	total = total + 2 ** i * int(a[i])
count = 0
i = 0
while True:
	if 4 ** i < total:
		count = count + 1
		i = i + 1
	else:
		print(count)
		exit()


import math

def func(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal
a = int(input())
a = func(a)
kk = 0
sum = 0
while 1:
	if 4 ** kk < a:
		sum += 1
		kk += 1
	else:
		break
print(sum)


n = int(input())
k = str(n)
k = k[::-1]
d = 0
for i in range(len(str(n))):
	if k[i] == '1':
		d += 2 ** i
s = 0
while 4 ** s < d:
	s += 1
print(s)


n = int(input(), 2)
m = 0
while 4 ** m < n:
	m += 1
print(m)


s = input()
p = '0b' + s
a = int(p, 2)
i = 0
while 4 ** i < a:
	i += 1
print(i)


s = input()
n = int(s, 2)
k = 1
ans = 0
while n > k:
	k <<= 2
	ans += 1
print(ans)


l = [1]
for i in range(1, 101):
	l.append(l[i - 1] * 4)
s = input()
s = int(s, 2)
ans = 0
for i in l:
	if i < s:
		ans += 1
	else:
		break
print(ans)


n = int(input(), 2)
x = 1
z = 0
while x < n:
	x = x * 4
	z = z + 1
print(z)


import math as m
s = input()
s_len = len(s)
if s.count('1') == 1:
	print(m.ceil((s_len - 1) / 2))
elif s == '0':
	print(0)
else:
	print(m.ceil(s_len / 2))


n = input()
n = n[::-1]
suma = 0
pot = 1
for i in n:
	if i == '1':
		suma += pot
	pot *= 2
i = 1
wyn = 0
while True:
	if i < suma:
		wyn += 1
	else:
		print(wyn)
		break
	i *= 4


s = str(input())
count = 0
for i in range(len(s)):
	if s[i] == '1':
		count += 1
	if count == 2:
		if len(s) % 2 == 1:
			print((len(s) + 1) // 2)
		else:
			print(len(s) // 2)
		break
if count != 2:
	if len(s) % 2 == 1:
		print((len(s) - 1) // 2)
	else:
		print(len(s) // 2)


s = input()
n = len(s)
sum1 = 0
for i in range(n):
	sum1 += int(s[i]) * pow(2, n - 1 - i)
i = 0
while pow(4, i) < sum1:
	i += 1
print(i)


a = input()
b = 0
for x in a:
	if x == '1':
		b += 1
if b <= 1:
	print(len(a) // 2)
else:
	print((len(a) + 1) // 2)


s = int(input(), 2)
c = 0
for i in range(0, 50):
	if s > 4 ** i:
		c += 1
print(c)


s = input()
k = (len(s) - 1) // 2
t = 0
if s == '10':
	t = 1
elif s.count('1') > 1:
	t = k + 1
elif len(s) % 2 == 0:
	t = k + 1
else:
	t = k
print(t)


n = int(input(), 2)
arr = []
for i in range(0, 51):
	arr.append(4 ** i)
i = 0
while i < len(arr):
	if arr[i] >= n:
		break
	i += 1
print(i)


import sys
input = sys.stdin.readline
s = int(input(), 2)
for i in range(10000):
	if 4 ** i >= s:
		break
print(i)


import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10 ** 9 + 7
inf = float('inf')

def I():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))
n = input()
m = len(n)
ans = math.ceil(m / 2)
if m == 1:
	print(0)
	quit()
elif m % 2 == 1 and int(n[0]) == 1 and (sum(list(map(int, list(n)))) == 1):
	ans -= 1
print(ans)


s = input()
l = len(s)
n = 0
for i in range(l):
	if s[i] == '1':
		n += 2 ** (l - 1 - i)
t = 2 ** (l - 1)
if n > t:
	print((l + 1) // 2)
else:
	print(l // 2)


def n_train(s):
	acum = 1
	cont = 0
	while acum < s:
		cont += 1
		acum *= 4
	return cont
bina = input()
dec = int(bina, 2)
print(n_train(dec))


a = int(input(), base=2)
s = 0
k = 0
while s < a:
	s = 4 ** k
	k += 1
if a == 0:
	k = 1
print(k - 1)


s = input()
l = len(s)
sum = 0
for i in range(l):
	if s[i] == '1':
		sum = sum + 2 ** (l - i - 1)
ans = 0
while True:
	if 4 ** ans >= sum:
		break
	ans = ans + 1
print(ans)


a = input()
c1 = 0
leng = len(a)
ans = int(leng / 2)
flag = 0
r = 0
for i in a:
	if r != 0 and i == '1':
		flag = 1
		break
	if r == 0:
		r = r + 1
if flag == 1:
	if leng % 2 != 0:
		ans = ans + 1
print(ans)


def toDecimal(value):
	num = 0
	for i in range(len(value)):
		num += int(value[len(value) - 1 - i]) * 2 ** i
	return int(num)
cadena = input()
s = toDecimal(cadena)
cont = 0
t = 1
while t < s:
	cont += 1
	t = 4 ** cont
print(cont)


s = input()
if len(s) == 1:
	print(0)
else:
	c = len(s)
	cnt = 0
	for i in s:
		cnt += i == '1'
	if c % 2 == 1 and cnt > 1:
		c += 1
	print(c // 2)


def base_convert(i, b):
	result = []
	while i > 0:
		result.insert(0, i % b)
		i = i // b
	return result
s = input()
lst = 0
bf = 0
for i in range(len(s)):
	if list(reversed(s))[i] == '1':
		lst = i + 1
		bf += 1
print((lst + (bf >= 2)) // 2)


b = input()
binary = int(b)
(decimal, i, n) = (0, 0, 0)
while binary != 0:
	dec = binary % 10
	decimal = decimal + dec * pow(2, i)
	binary = binary // 10
	i += 1
a = 1
count = 0
while a < decimal:
	count += 1
	a *= 4
print(count)


time = int(input(), 2)
now = 1
cnt = 0
while now < time:
	now = now << 2
	cnt += 1
print(cnt)


s = input()
n = int(s, 2)
ans = 0
product = 1
while product < n:
	product *= 4
	ans += 1
print(ans)


from math import ceil
Minute = input()
print(len(Minute) // 2 if Minute.count('1') == 1 or Minute == '0' else ceil(len(Minute) / 2))


(cnt, cur) = (0, 1)
a = int(input(), 2)
while 1:
	if cur >= a:
		break
	cnt += 1
	cur *= 4
print(cnt)


entry = int(input(), 2)
time = 0
count = 0
if entry == 1:
	print(0)
else:
	while time < entry:
		count += 1
		time = 4 ** count
	print(count)


s = input()
t = False
for c in s[1:]:
	if c == '1':
		t = True
		break
razrad = len(s) - 1
if t:
	print(razrad // 2 + 1)
else:
	print((razrad - 1) // 2 + 1)


def convert(x):
	s = len(str(x))
	t = 0
	for i in range(s):
		t += x % 10 * 2 ** i
		x = x // 10
	return t
n = int(input())
ans = 0
while 4 ** ans < convert(n):
	ans += 1
print(ans)


s = input()
a = []
for i in s:
	a.append(int(i))
num = 0
for i in range(len(s) - 1, -1, -1):
	num += 2 ** (len(s) - i - 1) * a[i]
k = 0
while k >= 0:
	if 4 ** k >= num:
		break
	k += 1
print(k)


s = input()
count = 0
for i in range(len(s)):
	if s[i] == '1':
		count += 1
res = 0
for i in range(len(s) - 1, -1, -2):
	res += 1
if count == 1 and len(s) % 2 == 1:
	res -= 1
if len(s) == 1:
	print(0)
else:
	print(res)


import math
s = int(input(), 2)
ans = 0
val = 1
while val < s:
	val *= 4
	ans += 1
print(ans)


a = input()
d = int(a, 2)
count = 0
for x in range(51):
	if pow(4, x) < d:
		count = count + 1
	else:
		break
print(count)


n = int(input(), 2)
if n == 0:
	print('0')
	exit()
else:
	c = 0
	x = 0
	i = 0
	while x < n:
		x = pow(4, i)
		i += 1
		c += 1
		if x == n:
			break
	print(c - 1)


s = list(input())
sol = 0
n = len(s)
if s.count('1') > 1 and n % 2 == 1:
	sol = 1 + n // 2
elif s.count('1') == 0:
	sol = 0
else:
	sol = n // 2
print(sol)


n = input()
n = int(n, 2)
num = 0
if n == 0 or num == 1:
	print(0)
else:
	for i in range(n):
		if 4 ** i < n:
			num += 1
		else:
			print(num)
			break


from math import *
s = input()
a = len(s)
c = ceil(float(a) / 2.0)
b = 1
if (a - 1) % 2 == 0:
	for i in range(1, a):
		if int(s[i]) == 0:
			b = 0
			continue
		else:
			b = 1
			break
if b == 0:
	c = c - 1
if a == 1:
	c = 0
print(c)


def f1():
	x = str(input())
	i = 0
	numero = int(x, 2)
	while True:
		if pow(4, i) >= numero:
			return i
			break
		else:
			i += 1
print(f1())


n = int(input(), base=2)
tmp = 1
ans = 0
while tmp < n:
	tmp *= 4
	ans += 1
print(ans)


import math
a = input()
y = int(a, 2)
x = 0
while pow(4, x) < y:
	x = x + 1
print(x)


a = input()
ans = 0
base = 1
s = ''
for i in a:
	s = i + s
for i in s:
	if i == '1':
		ans = ans + base
	base = base * 2
l = 1
count = 0
while l < ans:
	count = count + 1
	l = l * 4
print(count)


x = int(input(), 2)
ans = 0
curr = 1
while curr < x:
	curr *= 4
	ans += 1
print(ans)


binary = input()
digits = len(binary)
resp = digits // 2
count1 = 0
if digits % 2 != 0:
	for digit in binary:
		if digit == '1':
			count1 += 1
		if count1 == 2:
			resp += 1
			break
print(resp)


n = input()
c = len(n) // 2
s = n.split('1')
if len(s) > 2 and len(n) == c * 2 + 1:
	c += 1
print(c)


n = input()
zeros = len(n) - 1
ones = n.count('1')
if n == '0' or n == '1':
	print(0)
elif n == '10' or n == '11':
	print(1)
elif zeros % 2 == 0 and ones == 1:
	print(zeros // 2)
elif zeros % 2 == 0 and ones != 1:
	print(zeros // 2 + 1)
elif zeros % 2 == 1:
	print((zeros + 1) // 2)


MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
s = input()
ans = len(s) // 2
k = s.count('1')
print(ans + len(s) % 2 * (k > 1))


s = input()
g = 0
for i in range(1, len(s)):
	if s[i] == '1':
		g = 1
		break
if len(s) == 1:
	print(0)
elif len(s) == 2:
	print(1)
elif g == 0:
	print(len(s) // 2)
else:
	print((len(s) + 1) // 2)


m = int(input())
k = 1
i = 0
while k < m:
	k = k * 100
	i += 1
print(i)


s = input()
print((len(s) - 1) // 2 + ((len(s) - 1) % 2 or '1' in s[1:]))


n = input()
n = int(n, 2)
n = n % 2 ** 100
i = 0
t = 0
while t == 0:
	if n > 4 ** i:
		i += 1
	else:
		t = 1
print(i)


n = int(input(), 2)
pot = 1
count = 0
while pot < n:
	pot = 4 * pot
	count += 1
print(count)


s = input()
n = len(s)
flag = False
for i in range(1, n):
	if s[i] != '0':
		flag = True
if flag:
	print((n + 1) // 2)
else:
	print(n // 2)


s = input()
d = int(s, 2)
temp = d
count = 0
if d <= 1:
	print(0)
elif d > 1 and d <= 4:
	print(1)
else:
	for i in range(1, d + 1):
		if d > 4 ** i:
			count += 1
		else:
			break
	print(count + 1)


n = input()
n = int(n, 2)
cnt = 0
i = 0
while 1:
	if pow(4, i) < n:
		cnt += 1
		i += 1
	else:
		break
print(cnt)


v = int(input(), 2)
k = 0
while v > 4 ** k:
	k = k + 1
print(k)


s = input()
import sys
if s == '0' or s == '1':
	print(0)
	sys.exit(0)
n = len(s)
buf = ''
for i in range(n):
	buf += s[n - i - 1]
s = buf
one = 0
ans = 0
for i in range(n - 1):
	if s[i] == '1':
		one += 1
	if i % 2 == 0:
		ans += 1
if one and n % 2 == 1:
	ans += 1
print(ans)


import math

def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	if binary1 == 0:
		return 0
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal

def isPowerOfTwo(x):
	if x == 0:
		return False
	while x != 1:
		if x % 4 != 0:
			return False
		x = x // 4
	return True
val = int(input())
dec = binaryToDecimal(val)
if val == 0:
	print(0)
	exit()
elif val == 1:
	print(0)
	exit()
for i in range(0, dec):
	if pow(4, i) > dec:
		temp = i
		break
if isPowerOfTwo(dec):
	temp = temp - 1
print(temp)


import math
s = input()
n = len(s)
x = int('1' + (n - 1) * '0')
if int(s) % x == 0:
	print(n // 2)
else:
	print(math.ceil(n / 2))


s = input()
num = int(s, 2)
itr = 0
while 4 ** itr < num:
	itr += 1
print(itr)


def calc(s):
	k = 0
	if s <= 1:
		return k
	else:
		a = 1
		while a < s:
			a = a * 4
			k += 1
		return k
s = int(input(), 2)
ans = calc(s)
print(ans)


import sys
s = sys.stdin.readline().strip()
ans = (len(s) + 1) // 2
if s == '0':
	ans = 0
elif s == '1' + '0' * (ans * 2 - 2):
	ans = ans - 1
print(ans)


a = int(input(), 2)
for k in range(0, 100):
	if 4 ** k >= a:
		print(k)
		break


import itertools
import math
from collections import defaultdict

def input_ints():
	return list(map(int, input().split()))

def solve():
	x = int(input(), 2)
	ans = 0
	p = 1
	while p < x:
		ans += 1
		p *= 4
	print(ans)

def __starting_point():
	solve()
__starting_point()


l = input()
n = len(l)
c = 0
for i in range(n):
	c = c + int(l[n - i - 1]) * pow(2, i)
for i in range(n):
	if pow(4, i) >= c:
		m = i
		break
print(m)


import math
s = input()
s1 = int(s, 2)
if s1 == 1 or s1 == 0:
	print(0)
elif s1 <= 4:
	print(1)
else:
	count = 2
	temp = 16
	while True:
		if temp >= s1:
			break
		else:
			temp *= 4
			count += 1
	print(count)


from sys import stdin

def decimal(B):
	result = 0
	B = B[::-1]
	for b in range(len(B)):
		result += 2 ** b if int(B[b]) else 0
	return result

def main():
	num = decimal(stdin.readline()[:-1])
	result = 0
	while 4 ** result < num:
		result += 1
	print(result)
	return
main()


s = input()
s = int(s, 2)
c = 1
f = 0
while c < s:
	c = c * 4
	f += 1
print(f)


s = input()
sum = 0
for bit in range(0, len(s)):
	if s[bit] == '1':
		sum = sum + 2 ** (len(s) - bit - 1)
ans = 0
t = 1
while t < sum:
	t = t * 4
	ans += 1
print(ans)


bn = input()
n = int(bn, 2)
count = 0
a = 1
while a < n:
	count += 1
	a = a * 4
print(count)


import math
s = input()
q = 0
for i in s:
	q = q * 2 + int(i)
t = 0
while 1:
	if 4 ** t > q:
		print(t)
		break
	elif 4 ** t == q:
		print(t)
		break
	else:
		t += 1


s = input()
num = 0
for i in range(len(s)):
	num = num * 2
	if s[i] == '1':
		num = num + 1
tnum = 1
if num == 0:
	print(0)
else:
	for i in range(0, 200):
		if tnum >= num:
			print(i)
			break
		tnum = tnum * 4


n = input()
dec = int(n, 2)
cnt = 0
k = dec
while dec != 0:
	dec = dec // 4
	cnt += 1
if 4 ** (cnt - 1) == k:
	print(cnt - 1)
else:
	print(cnt)


import math
line = int(input(), 2)
x = 1
output = 0
if line == 0:
	print(0)
else:
	while x < line:
		output += 1
		x = x * 4
	print(int(output))


def main(s):
	n = binary_to_decimal(s)
	index = 1
	x = 0
	while index < n:
		x = x + 1
		index = index * 4
	return x

def binary_to_decimal(a):
	index = 0
	count = 0
	while index < len(a):
		count = count + int(a[index]) * 2 ** (len(a) - (index + 1))
		index = index + 1
	return count
s = input()
res = main(s)
print(res)


import math
n = input()
sum1 = 0
x = 1
c = 0
j = 0
for i in reversed(n):
	if i != '0':
		sum1 = sum1 + pow(2, j)
	j += 1
while sum1 > x:
	c += 1
	x *= 4
print(c)


import math

def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal
convertedList = []
ConvertedNum = binaryToDecimal(int(input('')))
i = 0
if ConvertedNum != 1:
	while 4 ** i < ConvertedNum:
		convertedList.append(4 ** i)
		i += 1
	print(len(convertedList))
elif ConvertedNum == 1:
	print('0')


s = input()
n = len(s)
r = n // 2
if n % 2 == 1 and s.count('1') > 1:
	print(r + 1)
else:
	print(r)


a = int(input(), 2)
b = 0
i = 1
while i < a:
	b = b + 1
	i = i * 4
print(b)


l1 = input()
n = []
if l1 == '0':
	print('0')
else:
	for i in l1:
		n.append(i)
	x = len(n)
	if x % 2 == 0:
		print(x // 2)
	elif n.count('1') == 1:
		print(x // 2)
	else:
		print(x // 2 + 1)


import math
s = str(input())
if s == '0':
	print(0)
else:
	print(math.ceil(len(s) / 2) if s.count('1') > 1 else math.ceil((len(s) - 1) / 2))


n = int(input())
m = str(n)
num = 0
p = 0
k = len(m) - 1
count = 0
for i in range(len(m)):
	num = num + int(m[k]) * 2 ** i
	k = k - 1
req = num
while p >= 0:
	if 4 ** p < num:
		count = count + 1
	else:
		break
	p = p + 1
print(count)


s = int(input(), base=2)
i = 0
while (1 << i) * (1 << i) < s:
	i = i + 1
print(i)


bin_rep = input()
x = len(bin_rep) - 1
one_count = bin_rep.count('1')
ans = 0
if one_count == 1:
	if x % 2 == 0:
		k = x // 2
		ans = k
	else:
		k = x // 2
		if pow(4, k) < pow(2, x):
			ans = k + 1
		else:
			ans = k
elif one_count > 1:
	k = x // 2 + 1
	ans = k
print(ans)


s = int(input(), base=2)
(x, count) = (1, 0)
while x < s:
	count += 1
	x *= 4
print(count)


s = input()
c = 0
for i in range(len(s)):
	if s[i] == '1':
		c = c + pow(2, len(s) - 1 - i)
x = c
c = 0
k = 1
while k < x:
	c = c + 1
	k = k * 4
print(c)


def BtoD(num):
	r = s = 0
	base = 1
	while num != 0:
		r = num % 10
		s += r * base
		num //= 10
		base *= 2
	return s
s = int(input())
i = c = 0
while int(pow(4, i)) < BtoD(s):
	i += 1
	c += 1
print(c)


import sys
for line in sys.stdin:
	line.rstrip()
	time = int(line, 2)
	n = 0
	t = 1
	while t < time:
		n += 1
		t *= 4
	print(n)


a = int(input(), 2)
i = 0
ans = 0
while True:
	if 4 ** i < a:
		ans += 1
	else:
		break
	i += 1
print(ans)


n = input()
if n == '0':
	print(0)
elif len(n) % 2 == 1:
	if n.count('1') == 1:
		print((len(n) - 1) // 2)
	else:
		print((len(n) + 1) // 2)
else:
	print(len(n) // 2)


a = int(input(), 2)
n = 0
b = 1
while 4 ** n < a:
	n += 1
print(n)


a = int(input(), 2)
b = int(a)
l = 0
r = 60
s = [1]
for i in range(60):
	s.append(s[-1] * 4)
while l + 1 < r:
	m = (l + r) // 2
	if s[m] >= b:
		r = m
	else:
		l = m
if b == 1 or b == 0:
	print(0)
else:
	print(r)


s = input()
s = s[::-1]
ans = 0
for (i, c) in enumerate(s):
	if i % 2 == 0:
		ans += 1
number_ones = 0
for c in s:
	if int(c) == 1:
		number_ones += 1
if number_ones < 2 and len(s) % 2 == 1:
	ans -= 1
print(ans)


str = input('')
n = 0
m = 1
for i in range(len(str) - 1, -1, -1):
	n = n + int(str[i]) * m
	m = m * 2
ans = 0
tmp = 1
while tmp < n:
	ans = ans + 1
	tmp = tmp * 4
print(ans)


s = input()

def binaryToDecimal(n):
	return int(n, 2)
value = binaryToDecimal(s)
i = 0
while 1:
	ans = pow(4, i)
	if ans >= value:
		break
	i = i + 1
print(i)


s = input()
k = 1
if s == '1' + '0' * (len(s) - 1) and len(s) % 2 == 1:
	k = 0
if s == '0':
	print(0)
else:
	print(k + int((len(s) - 1) / 2))


n = int(input(), 2)
n -= 1
if n <= 0:
	print(0)
else:
	print((len(bin(n)) - 1) // 2)


import math
q = 1
for i in range(q):
	s = input()
	x = int(s, 2)
	ans = 0
	for i in range(60):
		if 4 ** i < x:
			ans += 1
		else:
			break
	print(ans)


n = input()
res = 0
s = 1
for i in n[::-1]:
	res += s * int(i)
	s *= 2
(ans, k) = (0, 1)
while k < res:
	k *= 4
	ans += 1
print(ans)


s = input()
x = int(s, 2)
if x == 0 or x == 1:
	print(0)
else:
	mx = 1
	ans = 1
	while mx * 4 < x:
		mx *= 4
		ans += 1
	print(ans)


from math import ceil, log

def log_base_a(a, x):
	return log(x) / log(a)

def trains(arrival):
	if arrival == '0':
		return 0
	ones = arrival.count('1')
	if ones == 1:
		return len(arrival) // 2
	return (len(arrival) - 1) // 2 + 1
bin_minute = input()
print(trains(bin_minute))


def main():
	import sys
	input = sys.stdin.readline
	s = input()
	cnt = s.count('1')
	l = len(s) - 1
	if l & 1:
		if cnt > 1:
			print(l + 1 >> 1)
		else:
			print(l >> 1)
	else:
		print(l >> 1)
	return 0
main()


_binery_digit = input()

def converting(binery_digit):
	_binery_digit_list = [int(i) for i in binery_digit]
	decimal_conv = 0
	for digit in _binery_digit_list:
		decimal_conv = decimal_conv * 2 + digit
	station_schedule = []
	schedule_step = 0
	stop = 0
	while schedule_step < decimal_conv:
		schedule_step = 4 ** stop
		if schedule_step < decimal_conv:
			station_schedule.append(schedule_step)
			stop += 1
	res = len(station_schedule)
	return res
print(converting(_binery_digit))


import math
n = input()
p = int(n, 2)
if p != 0:
	k = int(math.log(p, 4))
	count = 0
	for i in range(0, k + 1):
		if 4 ** i < p:
			count += 1
	print(count)
else:
	print(0)


def binaryToDecimal(n):
	return int(n, 2)
n = input()
a = binaryToDecimal(n)
cnt = 0
for i in range(0, a):
	if 4 ** i < a:
		cnt += 1
	else:
		break
print(cnt)


a = input()
num = 0
for z in a:
	num *= 2
	if z == '1':
		num += 1
buf = 1
ans = 0
while num > buf:
	ans += 1
	buf *= 4
print(ans)


from sys import stdin, stdout
s = stdin.readline().rstrip()
if int(s) == 0 or int(s) == 1:
	stdout.write('0')
else:
	c = 0
	f = 0
	for i in range(1, len(s)):
		c += 1
		if s[i] == '1':
			f = 1
	stdout.write(str(c // 2 + max(c % 2, f)) + '\n')


s = input()
n = len(s)
x = 0
for i in range(n):
	x += (1 << n - i - 1) * int(s[i])
ans = 0
for i in range(100):
	if 4 ** i >= x:
		break
	else:
		ans += 1
print(ans)


s = input()
n = 0
x = len(s) - 1
count = 0
if x != 0 and s[0] != '0':
	for i in range(0, len(s)):
		if s[i] == '1':
			n += 2 ** x
			x = x - 1
	x = 1
	while x < n:
		x = 4 * x
		count = count + 1
	print(count)
else:
	print(0)


def BinarytoDec(n):
	num = n
	dec_value = 0
	base = 1
	temp = num
	while temp:
		last_digit = temp % 10
		temp = int(temp / 10)
		dec_value = dec_value + last_digit * base
		base = base * 2
	return dec_value
number = str(input())
val = int(number, 2)
res = 1
count = 0
while res < val:
	res = res * 4
	count = count + 1
print(count)


a = int(input())
b = 1
count = 0
while b < a:
	count = count + 1
	b = b * 100
print(count)


s = int(input(), 2)
k = 0
aux = 1
while aux < s:
	k += 1
	aux = 1 << 2 * k
print(k)


s = input()
a = False
for i in range(1, len(s)):
	if s[i] == '1':
		a = True
		break
if a or len(s) % 2 == 0:
	print((len(s) - 1) // 2 + 1)
else:
	print((len(s) - 1) // 2)


s = input().strip()
k = int(s, 2)
count = 0
t = 0
i = 0
for i in range(k):
	t = pow(4, i)
	if t >= k:
		break
print(i)


c = [1, 4, 16, 64, 256, 1024, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456, 1073741824, 4294967296, 17179869184, 68719476736, 274877906944, 1099511627776, 4398046511104, 17592186044416, 70368744177664, 281474976710656, 1125899906842624, 4503599627370496, 18014398509481984, 72057594037927936, 288230376151711744, 1152921504606846976, 4611686018427387904, 18446744073709551616, 73786976294838206464, 295147905179352825856, 1180591620717411303424, 4722366482869645213696, 18889465931478580854784, 75557863725914323419136, 302231454903657293676544, 1208925819614629174706176, 4835703278458516698824704, 19342813113834066795298816, 77371252455336267181195264, 309485009821345068724781056, 1237940039285380274899124224, 4951760157141521099596496896, 19807040628566084398385987584, 79228162514264337593543950336, 316912650057057350374175801344, 1267650600228229401496703205376, 5070602400912917605986812821504, 20282409603651670423947251286016, 81129638414606681695789005144064, 324518553658426726783156020576256, 1298074214633706907132624082305024, 5192296858534827628530496329220096, 20769187434139310514121985316880384, 83076749736557242056487941267521536, 332306998946228968225951765070086144, 1329227995784915872903807060280344576, 5316911983139663491615228241121378304, 21267647932558653966460912964485513216, 85070591730234615865843651857942052864, 340282366920938463463374607431768211456, 1361129467683753853853498429727072845824, 5444517870735015415413993718908291383296, 21778071482940061661655974875633165533184, 87112285931760246646623899502532662132736, 348449143727040986586495598010130648530944, 1393796574908163946345982392040522594123776, 5575186299632655785383929568162090376495104, 22300745198530623141535718272648361505980416, 89202980794122492566142873090593446023921664, 356811923176489970264571492362373784095686656, 1427247692705959881058285969449495136382746624, 5708990770823839524233143877797980545530986496, 22835963083295358096932575511191922182123945984, 91343852333181432387730302044767688728495783936, 365375409332725729550921208179070754913983135744, 1461501637330902918203684832716283019655932542976, 5846006549323611672814739330865132078623730171904, 23384026197294446691258957323460528314494920687616, 93536104789177786765035829293842113257979682750464, 374144419156711147060143317175368453031918731001856, 1496577676626844588240573268701473812127674924007424, 5986310706507378352962293074805895248510699696029696, 23945242826029513411849172299223580994042798784118784, 95780971304118053647396689196894323976171195136475136, 383123885216472214589586756787577295904684780545900544, 1532495540865888858358347027150309183618739122183602176, 6129982163463555433433388108601236734474956488734408704, 24519928653854221733733552434404946937899825954937634816, 98079714615416886934934209737619787751599303819750539264, 392318858461667547739736838950479151006397215279002157056, 1569275433846670190958947355801916604025588861116008628224, 6277101735386680763835789423207666416102355444464034512896, 25108406941546723055343157692830665664409421777856138051584, 100433627766186892221372630771322662657637687111424552206336, 401734511064747568885490523085290650630550748445698208825344]
n = int(input(), base=2)
for x in range(100):
	if c[x] >= n:
		break
print(x)


s = input()
n = len(s)
ok = False
cnt = 0
for i in range(n - 1, -1, -1):
	j = n - i - 1
	if s[i] == '1' and i > 0:
		ok = True
	if j % 2 == 0:
		cnt += 1
if n % 2 == 1 and ok != True:
	cnt -= 1
print(cnt)


s = input()
x = int(s, 2)
sum1 = 0
i = 1
while i < x:
	sum1 += 1
	i = i * 4
print(sum1)


n = int(input())
import math

def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal
x = binaryToDecimal(n)
i = 0
while 4 ** i < x:
	i += 1
print(i)


def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal
n = int(input())
m = binaryToDecimal(n)
k = 4
p = 1
cn = 0
if m == 1:
	cn = 0
else:
	while p < m:
		cn += 1
		p = p * k
print(cn)


n = int(input(), 2)
curr = 1
count = 0
while curr < n:
	curr = curr * 4
	count += 1
print(count)


num = str(input())
number = 0
for i in range(len(num)):
	number = number + int(num[len(num) - 1 - i]) * 2 ** i
pet = 1
count = 0
while number > pet:
	pet = pet * 4
	count = count + 1
print(count)


from sys import stdin
from math import ceil
s = stdin.readline().strip()
n = int(s, 2)
for i in range(110):
	if 4 ** i >= n:
		print(i)
		break


from sys import stdout
printn = lambda x: stdout.write(x)
inn = lambda : int(input())
inl = lambda : list(map(int, input().split()))
inm = lambda : map(int, input().split())
DBG = True
BIG = 999999999
R = 10 ** 9 + 7

def ddprint(x):
	if DBG:
		print(x)
s = input().strip()
n = len(s) - 1
m = n // 2
if n % 2 == 1:
	print(m + 1)
else:
	found = 0
	for i in range(1, len(s)):
		if s[i] == '1':
			found = 1
			break
	print(m + found)


c = int(input())
a = str(c)[::-1]
b = 0
j = 0
for i in range(len(a)):
	b += 2 ** i * int(a[i])
for k in range(50):
	if 4 ** k < b:
		j += 1
	else:
		break
print(j)


p = int(input())
s = str(p)
n = len(s)
if n % 2 == 0:
	a = n // 2
	print(a)
else:
	count = 0
	for i in range(n):
		if s[i] == '1':
			count += 1
	if count > 1:
		print(n // 2 + 1)
	else:
		print(n // 2)


t = input()
c = int(t, 2)
i = 1
k = 0
while i < c:
	i = i * 4
	k = k + 1
print(k)


x = input()
k = 0
count = 0
y = int(x, 2)
while 4 ** k < y:
	count = count + 1
	k = k + 1
print(count)


s = eval('0b' + input())
n = 0
for i in range(s):
	if 4 ** i < s:
		n += 1
	else:
		break
print(n)


from math import log
l = [1, 4, 16, 64, 256, 1024, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456, 1073741824, 4294967296, 17179869184, 68719476736, 274877906944, 1099511627776, 4398046511104, 17592186044416, 70368744177664, 281474976710656, 1125899906842624, 4503599627370496, 18014398509481984, 72057594037927936, 288230376151711744, 1152921504606846976, 4611686018427387904, 18446744073709551616, 73786976294838206464, 295147905179352825856, 1180591620717411303424, 4722366482869645213696, 18889465931478580854784, 75557863725914323419136, 302231454903657293676544, 1208925819614629174706176, 4835703278458516698824704, 19342813113834066795298816, 77371252455336267181195264, 309485009821345068724781056, 1237940039285380274899124224, 4951760157141521099596496896, 19807040628566084398385987584, 79228162514264337593543950336, 316912650057057350374175801344]
n = int(input(), 2)
c = 0
for j in l:
	if j < n:
		c += 1
	else:
		break
print(c)


Now = 1
Limit = 0
Ans = 0

def main():
	global Ans
	global Limit
	global Now
	inputStr = input()
	strLen = len(inputStr)
	for i in range(strLen):
		Limit = Limit * 2
		Limit = Limit + int(inputStr[i])
	while Now < Limit:
		Now = Now * 4
		Ans = Ans + 1
main()
print(Ans)


n = int(input())
(n1, n2) = (n, n)
(i, f, e, k) = (-1, 1, 0, 1)
(summa, w) = (0, 0)
while n2 != 0:
	if n2 % 10 == 1:
		e += 1
	n2 = n2 // 10
while n != 0:
	i += 1
	summa += n % 10 * 2 ** i
	n = n // 10
while summa > k:
	k = k * 4
	w += 1
print(w)


import math
a = input()
T = 0
t1 = 0
for t in range(0, len(a)):
	if a[t] == '1':
		T += 1 << len(a) - t - 1
		t1 += 1
if a == '0':
	print(0)
	quit()
ans = 0
x = 1
while x < T:
	x *= 4
	ans += 1
print(ans)


s = int(input(), 2)
count = 0
for i in range(0, 2 ** 100):
	if 4 ** i < s:
		count += 1
	else:
		break
print(count)


n = int(input(), 2)
(k, a) = (1, 0)
while k < n:
	a += 1
	k *= 4
print(a)


n = int(input())
k = 0
val = 0
while n != 0:
	val += n % 10 * pow(2, k)
	k += 1
	n = n // 10
p = 0
cnt = 0
num = pow(4, p)
while num < val:
	cnt += 1
	num *= 4
print(cnt)


import sys

def main():
	s = sys.stdin.readline().rstrip()
	s = s
	if '1' in s[1:]:
		return (len(s) + 1) // 2
	else:
		return len(s) // 2
print(main())


a = input()
a = int(a, 2)
answer = 0
b = 1
while b < a:
	answer += 1
	b *= 4
print(answer)


import math
n = int(input(), 2)
k = 0
i = 1
while i < n:
	i *= 4
	k += 1
print(k)


n = input()
c = n.count('1')
ans = int(len(n) / 2)
if c > 1 and len(n) % 2 == 1:
	ans += 1
print(ans)


s = int(input(), 2)
count = 0
while True:
	if 4 ** count < s:
		count += 1
	else:
		break
print(count)


n = input()
nd = int(n, 2)
trains = []
(y, x) = (0, 0)
while x < nd:
	x = 4 ** y
	trains.append(x)
	y += 1
print(len(trains) - 1) if len(trains) > 0 else print(0)


n = int(input(), 2)
trains = 0
while 4 ** trains < n:
	trains += 1
print(trains)


t = input()
num = int(t, 2)
if num == 0:
	print(0)
else:
	i = 0
	a = 0
	while a < num:
		a = int(4 ** i)
		i += 1
	print(i - 1)


n = int(__import__('sys').stdin.readline())
a = 1
cnt = 0
while a < n:
	cnt += 1
	a *= 100
print(cnt)


from sys import stdin
s = stdin.readline().rstrip()
p = 1
num = 0
for bit in reversed(s):
	if bit == '1':
		num += p
	p *= 2
ans = 0
cur = 1
while cur < num:
	ans += 1
	cur *= 4
print(ans)


from math import log, pow
a = input().strip()
if len(a) == 1:
	print('0')
elif int(a[1:]) == 0:
	print(int(len(a) / 2))
else:
	print(int((len(a) - 1) / 2) + 1)


from sys import stdin

def main():
	S = input()
	d = int(S, 2)
	ans = 0
	i = 0
	while 1:
		if 4 ** i >= d:
			break
		else:
			ans += 1
		i += 1
	print(ans)
input = lambda : stdin.readline()[:-1]
main()


import math
n = int(input(), 2)
resp = 0
while pow(4, resp) < n:
	resp = resp + 1
print(resp)


s = input()
n = 0
for i in s:
	n *= 2
	n += int(i)
now = 1
ans = 0
while now < n:
	now *= 4
	ans += 1
print(ans)


s = input()
n = int(s, 2)
c = 0
for i in range(51):
	c = 4 ** i
	if c >= n:
		break
print(i)


t = input()
x = 0
for i in range(1, len(t)):
	if t[i] == '1':
		x = 1
n = len(t) - 1
if n % 2 == 1:
	x = 1
n //= 2
print(n + x)


n = input()
decimal = int(n, 2)
count = 0
for i in range(51):
	if decimal > pow(4, i):
		count += 1
print(count)


number = input()
decimal = int(number, 2)
cont = 0
k = 1
if decimal != 0:
	while k < decimal:
		cont += 1
		k *= 4
	print(cont)
else:
	print(0)


num = int(input(), 2)
count = 0
curr = 1
while 1 == 1:
	if curr < num:
		count = count + 1
		curr = curr * 4
	else:
		break
print(count)


s = input()
val = int(s, 2)
z = 1
c = 0
while 1 * z < val:
	z = z * 4
	c = c + 1
print(c)


binary = str(input())
x = int(binary, 2)
t = 0
m = 0
while x > m and x < 4 ** 50:
	m = 4 ** t
	n = x / m
	t += 1
if t == 0:
	print(0)
else:
	print(t - 1)


values = [1] * 52
for i in range(52):
	values[i] *= 4 ** i
s = int(input(), 2)
count = 0
for v in values:
	if s > v:
		count += 1
print(count)


n = int(input())

def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal
k = 1
l = 1
n = binaryToDecimal(n)
if n == 1 or n == 0:
	print(0)
else:
	for i in range(1, 51):
		k = 4 * k
		if k >= n:
			l = i
			break
	print(l)


a = input()
a = a[::-1]
(z, s) = (0, 0)
for i in range(len(a)):
	if a[i] == '1':
		z += 2 ** i
while z > 4 ** s:
	s += 1
print(s)


A = input()
print((len(A) + 1) // 2 + (-1 if len(A) % 2 == 1 and all([x == '0' for x in A[1:]]) else 0))


s = int(input(), 2)
t = s
res = 0
while s:
	res += 1
	s //= 4
if 4 ** (res - 1) == t:
	res -= 1
print(res)


n = int(input(), 2)
j = 1
count = 0
while j < n:
	count += 1
	j = j * 4
if n == 0:
	count = 0
print(count)


n = input()
p = int(n, 2)
ct = 0
while 4 ** ct < p:
	ct += 1
print(ct)


time = input()
past1 = False
if len(time) == 1:
	print('0')
elif len(time) % 2 == 0:
	print(len(time) // 2)
elif len(time) % 2 != 0:
	for i in range(1, len(time)):
		if time[i] == '1':
			past1 = True
	if past1:
		print(len(time) // 2 + 1)
	else:
		print(len(time) // 2)


from sys import stdin, stdout
import heapq
import cProfile, math
from collections import Counter, defaultdict, deque
from bisect import bisect_left, bisect, bisect_right
import itertools
from copy import deepcopy
from fractions import Fraction
import sys, threading
import operator as op
from functools import reduce
import sys
sys.setrecursionlimit(10 ** 6)
threading.stack_size(2 ** 27)
fac_warm_up = False
printHeap = str()
memory_constrained = False
P = 10 ** 9 + 7

class MergeFind:

	def __init__(self, n):
		self.parent = list(range(n))
		self.size = [1] * n
		self.num_sets = n
		self.lista = [[_] for _ in range(n)]

	def find(self, a):
		to_update = []
		while a != self.parent[a]:
			to_update.append(a)
			a = self.parent[a]
		for b in to_update:
			self.parent[b] = a
		return self.parent[a]

	def merge(self, a, b):
		a = self.find(a)
		b = self.find(b)
		if a == b:
			return
		if self.size[a] < self.size[b]:
			(a, b) = (b, a)
		self.num_sets -= 1
		self.parent[b] = a
		self.size[a] += self.size[b]
		self.lista[a] += self.lista[b]

	def set_size(self, a):
		return self.size[self.find(a)]

	def __len__(self):
		return self.num_sets

def display(string_to_print):
	stdout.write(str(string_to_print) + '\n')

def prime_factors(n):
	factors = dict()
	for i in range(2, math.ceil(math.sqrt(n)) + 1):
		while n % i == 0:
			if i in factors:
				factors[i] += 1
			else:
				factors[i] = 1
			n = n // i
	if n > 2:
		factors[n] = 1
	return factors

def all_factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def fibonacci_modP(n, MOD):
	if n < 2:
		return 1
	return (cached_fn(fibonacci_modP, (n + 1) // 2, MOD) * cached_fn(fibonacci_modP, n // 2, MOD) + cached_fn(fibonacci_modP, (n - 1) // 2, MOD) * cached_fn(fibonacci_modP, (n - 2) // 2, MOD)) % MOD

def factorial_modP_Wilson(n, p):
	if p <= n:
		return 0
	res = p - 1
	for i in range(n + 1, p):
		res = res * cached_fn(InverseEuler, i, p) % p
	return res

def binary(n, digits=20):
	b = bin(n)[2:]
	b = '0' * (digits - len(b)) + b
	return b

def is_prime(n):
	if n < 4:
		return True
	if n % 2 == 0:
		return False
	if n % 3 == 0:
		return False
	i = 5
	w = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += w
		w = 6 - w
	return True

def generate_primes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	return prime
factorial_modP = []

def warm_up_fac(MOD):
	global factorial_modP, fac_warm_up
	if fac_warm_up:
		return
	factorial_modP = [1 for _ in range(fac_warm_up_size + 1)]
	for i in range(2, fac_warm_up_size):
		factorial_modP[i] = factorial_modP[i - 1] * i % MOD
	fac_warm_up = True

def InverseEuler(n, MOD):
	return pow(n, MOD - 2, MOD)

def nCr(n, r, MOD):
	global fac_warm_up, factorial_modP
	if not fac_warm_up:
		warm_up_fac(MOD)
		fac_warm_up = True
	return factorial_modP[n] * (pow(factorial_modP[r], MOD - 2, MOD) * pow(factorial_modP[n - r], MOD - 2, MOD) % MOD) % MOD

def test_print(*args):
	if testingMode:
		print(args)

def display_list(list1, sep=' '):
	stdout.write(sep.join(map(str, list1)) + '\n')

def display_2D_list(li):
	for i in li:
		print(i)

def prefix_sum(li):
	sm = 0
	res = []
	for i in li:
		sm += i
		res.append(sm)
	return res

def get_int():
	return int(stdin.readline().strip())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))
memory = dict()

def clear_cache():
	global memory
	memory = dict()

def cached_fn(fn, *args):
	global memory
	if args in memory:
		return memory[args]
	else:
		result = fn(*args)
		memory[args] = result
		return result

def ncr(n, r):
	return math.factorial(n) / (math.factorial(n - r) * math.factorial(r))

def binary_search(i, li):
	fn = lambda x: li[x] - x // i
	x = -1
	b = len(li)
	while b >= 1:
		while b + x < len(li) and fn(b + x) > 0:
			x += b
		b = b // 2
	return x
TestCases = False
fac_warm_up_size = 10 ** 5 + 100
optimise_for_recursion = False

def main():
	n = input()
	n = int(n, 2)
	for i in range(100):
		if 4 ** i >= n:
			break
	print(i)
if TestCases:
	for i in range(get_int()):
		main()
else:
	main() if not optimise_for_recursion else threading.Thread(target=main).start()


s = input()
number = 0
index = 0
for i in range(len(s) - 1, -1, -1):
	if s[i] == '1':
		number += pow(2, index)
	index += 1
answer = 0
count = 1
while count < number:
	count *= 4
	answer += 1
print(answer)


n = input()
if len(n) == 1:
	print(0)
else:
	cnt = (len(n) - 1) // 2
	if n.count('1') > 1 or len(n) % 2 == 0:
		cnt += 1
	print(cnt)


s = int(input(), 2)
ans = 0
k = 1
while k < s:
	ans += 1
	k *= 4
print(ans)


s = input()
t = 0
n = len(s)
for i in range(0, n):
	if s[i] == '1':
		t += 2 ** (n - 1 - i)
count = 0
flag = 1
k = 0
while flag:
	if 4 ** k < t:
		count += 1
		k += 1
	else:
		break
print(count)


it = 0
a = 1
numero = int(input(), 2)
while a < numero:
	a = a * 4
	it += 1
print(it)


def find(s):
	if len(s) % 2 == 0:
		return len(s) // 2
	else:
		ans = (len(s) + 1) // 2
		flag = 1
		for i in range(1, len(s)):
			if s[i] == '1':
				flag = 0
		return ans - flag
print(find(input()))


from sys import stdin
s = stdin.readline().strip()
ans = 0
t = '1'
while len(t) < len(s) or (len(t) == len(s) and t < s):
	ans += 1
	t += '00'
print(ans)


s = list(str(input()))
l = len(s)
sm = 0
dig1_count = 0
dig0_count = 0
c = 0
for i in range(0, l):
	if s[l - i - 1] == '1':
		sm = sm + 2 ** i
		dig1_count += 1
	else:
		dig0_count += 1
		pass
while sm > 0:
	c = c + 1
	sm = sm // 4
if dig0_count % 2 == 0 and dig1_count == 1:
	print(c - 1)
else:
	print(c)


bin = input()
n = int(bin, 2)
i = 0
a = 0
while 4 ** a < n:
	a += 1
print(a)


s = input()
s = s[::-1]
l = len(s)
d = 0
m = 0
k = 0
count = 0
for i in range(l):
	m = int(s[i]) * 2 ** i
	d = d + m
while 4 ** k < d:
	count = count + 1
	k = k + 1
print(count)


import math
m = input()
n = 0
for d in m:
	n = n * 2 + int(d)
if n != 0:
	a = 0
	while n > pow(4, a):
		a += 1
	print(a)
else:
	print(0)


n = int(input(), base=2)
i = 1
res = 0
while i < n:
	res += 1
	i *= 4
print(res)


s = input()
k = int(s, 2)
c = 0
i = 1
while i < k:
	c += 1
	i = i * 4
print(c)


n = list(input())
if len(n) % 2 == 0:
	print(int(len(n) // 2))
elif len(n) == 1 and n[0] == '0':
	print(0)
elif n[0] == '1' and n.count('1') == 1:
	print(int((len(n) - 1) / 2))
else:
	print(int((len(n) + 1) / 2))


n = input()
cnt = False
chk = False
for (i, e) in enumerate(n):
	if i == 0:
		continue
	if e == '1':
		chk = True
if chk == True and len(n) % 2 == 1:
	print(len(n) // 2 + 1)
elif chk == True and len(n) % 2 == 0:
	print(len(n) // 2)
else:
	print(len(n) // 2)


n = int(input(), 2)
x = 1
count = 0
while x < n:
	x *= 4
	count += 1
print(count)


s = input()
l = len(s)
res = l // 2
if l <= 2:
	print(res)
elif l % 2 and '1' in s[1:]:
	print(res + 1)
else:
	print(res)


a = int(input(), 2)
ans = 0
while 4 ** ans < a:
	ans += 1
print(ans)


import math
import sys

def bowwow(s):
	s = str(s)
	if len(s) == 1:
		return 0
	remainder = int(s[1:]) == 0
	return math.ceil(len(s) / 2) - (remainder and len(s) % 2 != 0)
num = int(sys.stdin.readline())
print(bowwow(num))


S = input()
L = len(S)
if L % 2 == 0:
	ans = L // 2
	print(ans)
else:
	ans = L // 2
	ok = False
	for i in range(1, L):
		if S[i] == '1':
			ok = True
	if ok:
		ans += 1
	print(ans)


s = input()
if s == '0' or s == '1':
	print(0)
else:
	cnt1 = 0
	ns = len(s)
	for i in range(1, len(s)):
		if s[i] == '1':
			cnt1 += 1
	num_zero = len(s) - 1
	pow4 = num_zero // 2
	if cnt1 == 0:
		if num_zero % 2 != 0:
			print(pow4 + 1)
		else:
			print(pow4)
	else:
		print(pow4 + 1)


x = input().strip()
if len(x) % 2 == 1 and x.count('1') > 1:
	print(len(x) // 2 + 1)
else:
	print(len(x) // 2)


s = input()
n = int(s, 2)
c = 0
for i in range(0, n + 1):
	if pow(4, i) < n:
		c += 1
	else:
		break
print(c)


s = int(input(), 2)
for i in range(110)[::-1]:
	if 1 << i * 2 < s:
		print(i + 1)
		break
else:
	print(0)


from math import *
s = input()
val = int(s, 2)
c = 0
p = 1
while p < val:
	c = c + 1
	p = p * 4
print(c)


def binaryToDecimal(n):
	return int(n, 2)
num = input()
n = binaryToDecimal(num)
k = 1
c = 0
i = 1
while k < n:
	k = 4 ** i
	c += 1
	i += 1
print(c)


count = 0
b = int(input(), 2)
a = [1, 4, 16, 64, 256, 1024, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456, 1073741824, 4294967296, 17179869184, 68719476736, 274877906944, 1099511627776, 4398046511104, 17592186044416, 70368744177664, 281474976710656, 1125899906842624, 4503599627370496, 18014398509481984, 72057594037927936, 288230376151711744, 1152921504606846976, 4611686018427387904, 18446744073709551616, 73786976294838206464, 295147905179352825856, 1180591620717411303424, 4722366482869645213696, 18889465931478580854784, 75557863725914323419136, 302231454903657293676544, 1208925819614629174706176, 4835703278458516698824704, 19342813113834066795298816, 77371252455336267181195264, 309485009821345068724781056, 1237940039285380274899124224, 4951760157141521099596496896, 19807040628566084398385987584, 79228162514264337593543950336, 316912650057057350374175801344, 1267650600228229401496703205376]
while b > a[count]:
	count = count + 1
print(count)


a = int(input(), 2)
(q1, q2) = (1, 0)
while q1 < a:
	q1 *= 4
	q2 += 1
print(q2)


k = input()
ans = 0
index = 0
step = 0
res = 0
for i in range(len(k) - 1, -1, -1):
	if k[index] == '1':
		ans = ans + (1 << i)
	index = index + 1
while 1:
	if 1 << 2 * step < ans:
		res = res + 1
		step = step + 1
	else:
		break
print(res)


from sys import stdin
from math import ceil
s = stdin.readline()
s1 = ''
for i in range(len(s) - 1, -1, -1):
	s1 += s[i]
num = 0
for i in range(len(s1)):
	if s1[i] == '1':
		num += pow(2, i - 1)
ans = 0
v = 0
var = 0
while True:
	if var >= num:
		break
	var = pow(4, v)
	v += 1
if v == 0:
	print(0)
else:
	print(v - 1)


n = input()
ans = int(len(n) / 2)
if n == '0':
	ans = 0
elif n.count('1') > 1 and len(n) % 2:
	ans += 1
print(ans)


b = input()
d = int(b, 2)
count = 0
i = 1
while True:
	if i >= d:
		break
	else:
		i = i * 4
		count = count + 1
print(count)


s = input()
if s == '0':
	print(0)
	exit(0)
if len(s) & 1:
	fl = 0
	if s.count('1') == 1:
		fl = 1
	print((1 + len(s)) // 2 - fl)
else:
	print(len(s) // 2)


s = int(input(), 2)
i = 1
count = 0
while i < s:
	count += 1
	i = i * 4
print(count)


s = int(input())
ind = 0
count = 0
for i in range(0, 101, 2):
	if s <= 10 ** i:
		break
	count += 1
print(count)


import math
import sys
DEBUG = False

def inp():
	return sys.stdin.readline().rstrip()

def dprint(*value, sep=' ', end='\n'):
	if DEBUG:
		print(*value, sep=sep, end=end)

def solve(N):
	for k in range(10 * 100):
		if N <= 4 ** k:
			return k

def main():
	print(solve(int(inp(), base=2)))
main()


s = input()
zeros = s.count('0')
if s[0] == '0':
	print(0)
elif zeros == len(s) - 1:
	if zeros % 2:
		print(zeros // 2 + 1)
	else:
		print(zeros // 2)
else:
	print((len(s) - 1) // 2 + 1)


def power(n, p):
	if p == 0:
		return 1
	if p == 1:
		return n
	n1 = n
	while p > 1:
		n = n * n1
		p -= 1
	return n

def ans(n):
	n1 = 4
	k = 1
	while n1 < n:
		n1 = n1 * 4
		k += 1
	return k
s = input()
n = 0
l = len(s)
if int(s) == 0 or int(s) == 1:
	print(0)
else:
	for i in range(l):
		n += int(s[l - i - 1]) * power(2, i)
	print(ans(n))


(n, cnt) = (input(), 0)
n1 = int(n, 2)
while 4 ** cnt < n1:
	cnt += 1
print(cnt)


from math import ceil, floor

def perevod(x):
	if len(str(x)) <= 1:
		return 0
	elif len(str(x)) % 2 == 0:
		return int(len(str(x)) / 2)
	x = str(x)
	k = len(str(x))
	if int(x[1:]) < 1:
		return int(floor(k / 2))
	else:
		return int(ceil(k / 2))
print(perevod(input()))


n = input()

def binaryToDecimal(n):
	return int(n, 2)
number = binaryToDecimal(n)
obtained = 1
k = 1
counter = []
while obtained < number:
	counter.append(obtained)
	obtained = 4 ** k
	k += 1
print(len(counter))


import math
s = input()
dec = int(s, 2)
if dec == 0:
	print(0)
	exit(0)
x = math.log(dec, 4)
y = int(4 ** x)
z = dec - y
if int(x) == x and z <= 0:
	print(int(x))
else:
	print(int(x) + 1)


import sys
s = input()
n = len(s)
if int(s) <= 1:
	print(0)
	exit(0)
if int(s[1:]) == 0 and n % 2 == 1:
	print((n + 1) // 2 - 1)
else:
	print((n + 1) // 2)


s = input()
n = len(s) // 2
if len(s) % 2 == 1:
	for i in range(1, len(s)):
		if s[i] == '1':
			n += 1
			break
print(n)


s = input()
b = int(s, 2)
ans = 0
p = 0
while 4 ** p < b:
	ans += 1
	p += 1
print(ans)


n = int(input(), 2)
j = 0
count = 0
while 1 << j < n:
	j += 2
	count += 1
print(count)


from math import pow
n = int(input(), 2)
i = 0
while pow(4, i) < n:
	i += 1
print(i)


s = input()
num = 0
k = 0
ans = 1
cnt = 0
for i in range(len(s) - 1, -1, -1):
	num += int(s[i]) * pow(2, k)
	k += 1
k = 0
while ans < num:
	ans = pow(4, k)
	if ans < num:
		cnt += 1
	else:
		break
	k += 1
print(cnt)


import math
s = input()
sum1 = 0
j = 0
y = int(s, 2)
cnt = 0
x = 1
while x < y:
	x = x * 4
	cnt += 1
print(cnt)


n = input()
n = int(n, 2)
ans = 0
for i in range(0, 60):
	if n > 4 ** i:
		ans += 1
print(ans)


s = str(input())
res = 0
curr = 1
n = int(s, 2)
while curr < n:
	res += 1
	curr = curr * 4
print(res)


import math
s = str(input())
l = len(s)
if l % 2 == 1:
	if s.count('1') > 1:
		print((l + 1) // 2)
	else:
		print(l // 2)
else:
	print(l // 2)


number = int(input(), 2)
k = 0
while number > pow(4, k):
	k += 1
print(k)


s = int(input(), 2)
k = 1
n = 0
i = 1
while s > k:
	k = 4 ** i
	i = i + 1
	n = n + 1
print(n)


s = input()
num = int(s, 2)
count = 0
z = 0
while 4 ** z < num:
	z += 1
	count += 1
print(count)


num_str = input()
num = 0
for (i, c) in enumerate(num_str[::-1]):
	digit = int(c)
	if digit == 1:
		num += 2 ** i
ans = 0
cur = 1
while cur < num:
	ans += 1
	cur *= 4
print(ans)


n = int(input(), 2)
ans = 0
t = 1
while t < n:
	ans += 1
	t *= 4
print(ans)


from math import *
from copy import *
from string import *
from random import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter

def Ceil(x):
	r = x % 1
	if r == 0:
		return int(x)
	else:
		return int(x // 1 + 1)
N = input()
if N == '0':
	print(0)
else:
	ans = 0
	N = int(N, 2)
	x = 1
	while N > x:
		x *= 4
		ans += 1
	print(ans)


gi = lambda : list(map(int, input().split()))
s = input()
ans = (len(s) - 1) // 2 + 1
if '1' not in s[1:] and (len(s) - 1) % 2 == 0:
	ans -= 1
print(ans)


def conv(n):
	return int(n, 2)
s = input()
z = conv(s)
c = 0
for i in range(51):
	if 4 ** i < z:
		c = c + 1
	else:
		print(c)
		break


x = int(input(), 2)
cnt = 0
while 4 ** cnt < x:
	cnt += 1
print(cnt)


import math
a = input()
n = int(a, 2)
m = n
if n > 0:
	k = 0
	while m % 4 == 0:
		m = m // 4
	while n != 0:
		n = n // 4
		k += 1
	if m == 1:
		print(k - 1)
	else:
		print(k)
else:
	print(0)


s = input()
l = [int(x) for x in s]
n = len(l)
ans = 0
i = 0
while n:
	ans += l[i] * 2 ** (n - 1)
	i += 1
	n -= 1
k = 0
t = 1
while t < ans:
	k += 1
	t *= 4
print(k)


s = str(int(input()) - 1)
if s == '-1' or s == '0':
	print(0)
else:
	print((len(s) + 1) // 2)


def binarytodecimal(num):
	decimal = 0
	i = 0
	while num != 0:
		dec = num % 10
		decimal = decimal + dec * pow(2, i)
		num = num // 10
		i += 1
	return decimal
n = int(input())
if n == 0:
	print('0')
elif n == 1:
	print('0')
else:
	var = binarytodecimal(n)
	t = 4
	if var == 1:
		print('0')
	for i in range(99):
		v = pow(t, i)
		v1 = pow(t, i + 1)
		if var == v:
			print(i)
		elif var > v and var <= v1:
			print(i + 1)
			break
		else:
			continue


n = int(input(), 2)
from math import *
x = 1
count = 0
while x < n:
	x = x * 4
	count += 1
print(count)


s = input()
n = len(s)
t = (n - 1) // 2
if '1' in s[1:] or n % 2 == 0:
	t += 1
print(t)


p = int(input(), 2)
i = 0
while 4 ** i < p:
	i += 1
print(i)


import math
number = input()
number_size = len(number)
number = list(number)
number_decimal = 0
for i in range(number_size):
	if number[number_size - i - 1] == '1':
		number_decimal += pow(2, i)
result = 0
if number_decimal > 1:
	acc = 1
	while acc < number_decimal:
		acc = acc * 4
		result += 1
print(result)


import math
n = input()
if len(n) == 1:
	ans = 0
else:
	ans = len(n) - len(n) // 2 - int('1' not in n[1:] and len(n) % 2 == 1)
print(ans)


n = input()
c = 0
for i in range(len(n)):
	if n[i] == '1':
		c += pow(2, len(n) - 1 - i)
i = 0
t = 0
while 1:
	if pow(4, i) < c:
		t += 1
	else:
		break
	i += 1
print(t)


import math
s = input()
c = 0
if len(s) == 1:
	print(0)
	exit(0)
for i in range(len(s)):
	if s[i] == '1':
		c = c + 1
if c == 1:
	x = len(s) - 1
	x = math.ceil(x / 2)
	x = int(x)
	print(x)
else:
	x = len(s) - 1
	if x % 2 == 0:
		x = math.ceil(x / 2)
		x = int(x)
		print(x + 1)
	else:
		x = math.floor(x / 2)
		x = int(x)
		print(x + 1)


a = input()
b = int(a, 2)
ans = 0
for i in range(b + 1):
	if 4 ** i < b:
		ans += 1
	else:
		break
print(ans)


import math
num = input('')
dec_num = '0b' + num
dec_num = int(dec_num, 2)
i = 0
while True:
	if 4 ** i >= dec_num:
		print(i)
		break
	i += 1


a = input()
ans = 0
p = 0
for i in a[::-1]:
	i = int(i)
	if i == 1:
		ans += 2 ** p
	p += 1
ans1 = 0
for i in range(100):
	if 4 ** i >= ans:
		print(i)
		break


s = input()[::-1]
pw = 0
n = 0
for i in s:
	if i == '1':
		n += 1 << pw
	pw += 1
c = 1
ans = 0
while c < n:
	c <<= 2
	ans += 1
print(ans)


import math as m
s = input()
ans = m.ceil(len(s) / 2)
c1 = s.count('1')
if c1 == 1 and len(s) % 2 != 0:
	ans -= 1
if c1 == 0:
	ans = 0
print(ans)


s = int(input(), 2)
s = int(s)
power = 0
c = 0
while 4 ** power < s:
	c += 1
	power += 1
print(c)


n = input()
n = int(n, base=2)
i = 0
p = 0
while i < n:
	if i != 0:
		p += 1
		i *= 4
	else:
		i += 1
print(p)


count = 0
num = 1
i = 0
ti = input()
deptime = int(ti, 2)
while num <= deptime:
	num = 4 ** i
	if num < deptime:
		count = count + 1
	i = i + 1
print(count)


vezes = int(input(), 2)
times = 0
number = pow(4, times)
while vezes > number:
	times += 1
	number = pow(4, times)
print(times)


num = list(input())
(value, j, k) = (0, 1, 0)
for i in range(len(num)):
	digit = num.pop()
	if digit == '1':
		value = value + pow(2, i)
while j < value:
	j = 4 * j
	k += 1
if value < 4 and value > 1:
	print(1)
else:
	print(k)


from collections import deque
from math import ceil, floor, sqrt, gcd

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def si():
	return input()
s = si()
s = list(s)
n = len(s)
c1 = 1
c = 0
for i in range(n - 1, 0, -2):
	if s[i] == '1' or s[i - 1] == '1':
		c = c1
	c1 += 1
if n % 2:
	if s[0] == '1':
		if s.count('1') == 1:
			c = c1 - 1
		else:
			c = c1
print(c)


mem = [0] * 1000

def memo():
	a = 1
	for i in range(1000):
		mem[i] = a
		a *= 4
memo()
s = input()
n = int(s, 2)
count = 0
i = 0
for i in range(1000):
	count += 1
	if mem[i] >= n:
		break
print(i)


num = int(input(), 2)
t = 0
while 4 ** t < num:
	t = t + 1
print(t)


from math import *
from collections import *
from itertools import *
from functools import *
from random import *

def getl(t=int):
	return [t(x) for x in input().split()]

def get(t=int):
	return t(input())
alphabet = [chr(x) for x in range(ord('a'), ord('z') + 1)]
alnum = lambda x: ord(x) - ord('a')

def main():
	s = input()
	n = len(s)
	ans = n // 2
	if s[1:].count('1') and n % 2 == 1:
		ans += 1
	print(ans)
main()


n = int(input())
for i in range(10 ** 9):
	x = i
	i = bin(4 ** i)
	i = int(i[2:])
	if i >= n:
		print(x)
		break
	i = x
111


t = int(input())
t = int(str(t), 2)
for i in range(101):
	if 4 ** i >= t:
		break
print(i)


from sys import stdin, stdout
import sys
INF = 100000000000.0
import bisect

def get_int():
	return int(stdin.readline().strip())

def get_ints():
	return map(int, stdin.readline().strip().split())

def get_array():
	return list(map(int, stdin.readline().strip().split()))

def get_string():
	return stdin.readline().strip()

def op(c):
	return stdout.write(c)
from collections import defaultdict
import math
n = get_int()
x = 0
i = 0
while n:
	a = n % 10
	x += int(math.pow(2, i) * a)
	n = n // 10
	i += 1
i = 0
a = 0
while a < x:
	a = int(math.pow(4, i))
	i += 1
if i == 0:
	print(0)
else:
	print(i - 1)


def power(a, b):
	if b == 0:
		return 1
	elif b % 2 == 0:
		return pow(power(a, b // 2), 2)
	else:
		return a * pow(power(a, b // 2), 2)

def decimal(s):
	ans = 0
	s = s[::-1]
	for i in range(len(s)):
		if s[i] == '1':
			ans += power(2, i)
	return ans
ans = 0
s = input()
n = decimal(s)
val = 1
ind = 1
while val < n:
	ans += 1
	val = power(4, ind)
	ind += 1
print(ans)


import math
n = input()
a = int(n, 2)
c = 0
k = 0
while math.pow(4, k) < a:
	c = c + 1
	k = k + 1
print(c)


time = input()
lenght = len(time)
isPowerOfTwo = True
for x in range(1, lenght):
	if time[x] == '1':
		isPowerOfTwo = False
lenght -= 1
if lenght % 2 == 1:
	print(1 + lenght // 2)
elif isPowerOfTwo:
	print(lenght // 2)
else:
	print(1 + lenght // 2)


import sys
s = input()
n = int(0)
for i in range(len(s)):
	if int(s[i]) == 1:
		n = n + pow(2, len(s) - i - 1)
ans = int(0)
for k in range(51):
	if pow(4, k) < n:
		ans += 1
print(ans)


n = input()
dec = int(n, 2)
count = 0
base = 1
while base < dec:
	count += 1
	base *= 4
print(count)


from collections import defaultdict, Counter
import copy, math
from copy import deepcopy
i = 0
l = [1, 4, 16, 64, 256, 1024, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456, 1073741824, 4294967296, 17179869184, 68719476736, 274877906944, 1099511627776, 4398046511104, 17592186044416, 70368744177664, 281474976710656, 1125899906842624, 4503599627370496, 18014398509481984, 72057594037927936, 288230376151711744, 1152921504606846976, 4611686018427387904, 18446744073709551616, 73786976294838206464, 295147905179352825856, 1180591620717411303424, 4722366482869645213696, 18889465931478580854784, 75557863725914323419136, 302231454903657293676544, 1208925819614629174706176, 4835703278458516698824704, 19342813113834066795298816, 77371252455336267181195264, 309485009821345068724781056, 1237940039285380274899124224, 4951760157141521099596496896, 19807040628566084398385987584, 79228162514264337593543950336, 316912650057057350374175801344, 1267650600228229401496703205376]
n = input()
n = int(n, 2)
for i in range(len(l)):
	if n <= l[i]:
		print(i)
		break


import io, sys, atexit, os
import math as ma

def li():
	return list(map(int, input().split()))

def num():
	return map(int, input().split())

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
mm = 1000000007
yp = 0

def solve():
	t = 1
	for tt in range(t):
		s = input()
		if s <= '1':
			print(0)
			continue
		pp = '100'
		cc = 1
		while True:
			if len(s) == len(pp) and s <= pp or len(pp) > len(s):
				print(cc)
				break
			else:
				pp = pp + '00'
				cc += 1
solve()


n = int(input(), 2)
k = 1
i = 0
while k < n:
	k = pow(4, i + 1)
	i += 1
print(i)


b = int(input(), 2)
ans = 0
n = 1
while n < b:
	n *= 4
	ans += 1
print(ans)


a = int(input())
b = 0
i = 0
while a > 0:
	b += a % 10 * 2 ** i
	a //= 10
	i += 1
i = 0
a = 0
while a < b:
	a = 4 ** i
	a = 4 ** i
	if a < b:
		i += 1
print(i)


l = list(input())
l.reverse()
c = 0
for i in range(len(l)):
	if l[i] == '1':
		c += 2 ** i
i = 0
while i >= 0:
	r = 4 ** i
	if r >= c:
		break
	else:
		i += 1
print(i)


num_s = input()
num = 0
for digit in num_s:
	num *= 2
	if digit == '1':
		num += 1
cnt = 0
cur = 1
while cur < num:
	cur *= 4
	cnt += 1
print(cnt)


q = int(input(), 2)
k = 0
while q > 4 ** k:
	k += 1
print(k)


def sii():
	return input()

def lmii():
	return list(map(int, input().split()))
n = sii()
r = int(n, 2)
for i in range(1000000):
	if 4 ** i >= r:
		print(i)
		break


import sys
s = int(input(), 2)
cnt = 0
for i in range(50):
	if s > 4 ** i:
		cnt += 1
print(cnt)


import math
s = str(input())
t = 0
for i in range(len(s)):
	t += pow(2, len(s) - i - 1) * int(s[i])
k = 0
while pow(4, k) < t:
	k += 1
print(k)


d = input()

def bin(n):
	return int(n, 2)
k = bin(d)
l = 0
while 1:
	res = pow(4, l)
	if res >= k:
		break
	l = l + 1
print(l)


import math
n = input()
cnt = len(n) // 2
if len(n) % 2 != 0 and '1' in n[1:len(n)]:
	cnt += 1
print(cnt)


inp2 = input()
inp = inp2[::-1]
total = 0
for i in range(len(inp)):
	if inp[i] == '1':
		total += 2 ** i
start = 1
count = 0
while start < total:
	count += 1
	start *= 4
print(count)


import math

def main():
	s = int(input(), 2)
	miss = 0
	t = 1
	while t < s:
		miss += 1
		t *= 4
	print(miss)
main()


b = input()
s = '0b' + b
num = int(s, 2)
c = 1
step = 0
while num > c:
	c = c * 4
	step += 1
print(step)


s = input().strip()
n = len(s)
ans = (n + 1) / 2
if n & 1 and s[1:] == '0' * (n - 1):
	ans -= 1
print(int(ans))


n = input()
l = len(n)
n1 = int(n)
ans = 0
if l % 2 == 1:
	if '1' in n[1:]:
		ans = l // 2 + 1
	else:
		ans = l // 2
else:
	ans = l // 2
print(ans)


import math
b = int(input(), 2)
cant = 1
res = 0
while cant < b:
	cant = cant * 4
	res += 1
print(res)


l = [0] * 51
l[0] = 1
for i in range(1, 51):
	l[i] = 4 ** i
n = input()
n = int(n, 2)
ky = 0
for i in range(0, 52):
	if n <= l[i]:
		ky = i
		break
print(ky)


def I():
	return int(input())

def IL():
	return list(map(int, input().split()))

def IS():
	return input()
s = IS()
n = int(s, 2)
x = [4 ** i for i in range(80)]
from bisect import bisect_left as bl
print(bl(x, n))


num = int(input())
num = int(str(num), 2)
k = 1
if num == 0 or num == 1:
	k = 0
else:
	while 1:
		if num >= 4 ** (k - 1) and num <= 4 ** k:
			break
		k = k + 1
print(k)


def bintodec(binary):
	b1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary:
		dec = binary % 10
		decimal += dec * pow(2, i)
		binary //= 10
		i += 1
	return decimal
c = 0
y = 1
bin = int(input())
ans = bintodec(bin)
while y < ans:
	c += 1
	y *= 4
print(c)


binary = input()
n = len(binary)
f = False
if n % 2 == 0:
	f = True
	n = n // 2
else:
	n = n + 1
	n = n // 2
flag = False
binary = binary[::-1]
if f != True:
	for bit in binary[:-1]:
		if bit == '1':
			flag = True
			break
	else:
		print(n - 1)
else:
	for bit in binary[:-2]:
		if bit == '1':
			flag = True
			break
	else:
		print(n)
if flag == True:
	print(n)


def main():
	s = input()
	n = len(s)
	if s == '0':
		print(0)
	else:
		ones = 0
		for i in range(n):
			if s[i] == '1':
				ones += 1
		ans = 0
		for i in range(n - 1, -1, -2):
			if i == 0:
				if ones > 1:
					ans += 1
			else:
				ans += 1
		print(ans)
main()


import math
n = int(input(), 2)
if n == 0:
	print(n)
else:
	f = math.log(n, 4)
	ff = int(4 ** f)
	if f != int(f) or n > ff:
		print(int(f) + 1)
	else:
		print(int(f))


x = int(input(), 2)
ans = 0
p = 1
while p < x:
	p *= 4
	ans += 1
print(ans)


import math

def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal
s = int(input())
a = binaryToDecimal(s)
ans = 0
for i in range(100):
	if math.pow(4, i) < a:
		ans += 1
print(ans)


s = input()
num = 0
c = 0
s = s[::-1]
for i in s:
	if i == '1':
		num += 2 ** c
	c += 1
c = 1
ans = 0
while c < num:
	c *= 4
	ans += 1
print(ans)


ss = str(input())
s = 0
for i in ss:
	s *= 2
	s += ord(i) - ord('0')
s2 = 1
ans = 0
while s2 < s:
	ans += 1
	s2 *= 4
print(ans)


s = input()
i = len(s) - 1
j = 0
num = 0
while i >= 0:
	num += int(s[i]) * 2 ** j
	i -= 1
	j += 1
k = 0
cn = 0
while 4 ** k < num:
	cn += 1
	k += 1
print(cn)


s = input()
print(len(s) // 2 if len([x for x in s if x == '1']) <= 1 or len(s) % 2 == 0 else len(s) // 2 + 1)


s = input()
n = len(s) - 1
if n % 2:
	print(int(n / 2) + 1)
	exit()
if '1' in s[1:]:
	print(int(n / 2) + 1)
	exit()
else:
	print(int(n / 2))


s = input()
c = len(s) - 1
for i in range(1, len(s)):
	if s[i] != '0':
		c = c + 1
		break
if c % 2 == 0:
	print(c // 2)
else:
	print(c // 2 + 1)


import sys
from collections import defaultdict as dd
from itertools import permutations as pp
from itertools import combinations as cc
from collections import Counter as ccd
from random import randint as rd
from bisect import bisect_left as bl
from heapq import heappush as hpush
from heapq import heappop as hpop
mod = 10 ** 9 + 7

def ri(flag=0):
	if flag == 0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())
a = input()
b = int(a, 2)
ans = 0
sol = 0
while 4 ** ans < b:
	ans += 1
	sol += 1
print(sol)


n = input()
s = n
b = s[len(s) - 1::-1]
a = len(s)
sum = 0
for i in range(a):
	sum += int(b[i]) * 2 ** i
k = 0
while 4 ** k < sum:
	k += 1
print(k)


b = int(input(), 2) - 1
i = 0
while True:
	num = 4 ** i
	if num > b:
		print(i)
		break
	i += 1


n = list(map(int, input()))
l = len(n) - 1
cnt = 0
p = 0
while l >= 0:
	if n[l] == 1:
		cnt += 2 ** p
	p = p + 1
	l = l - 1
if 4 ** (len(n) // 2) >= cnt:
	print(len(n) // 2)
else:
	print(len(n) // 2 + 1)


s = list(input())
missed = 0
time = ['1']
while len(s) > len(time):
	missed += 1
	time.append('0')
	time.append('0')
add = 0
if len(s) == len(time):
	for i in range(len(s)):
		if s[i] > time[i]:
			add = 1
			break
print(missed + add)


n = int(input(), base=2)
k = 0
while 4 ** k < n:
	k += 1
print(k)


t = int(input(), 2)
tr = 1
count = 0
while True:
	if tr < t:
		count += 1
		tr *= 4
	else:
		break
print(count)


ar = [4 ** i for i in range(2 * 201)]
n = input()
n = int(n, 2)
ans = 0
for i in ar:
	if i < n:
		ans += 1
print(ans)


s = input()
n = int(s, 2)
res = 0
f = 4
k = 0
while f ** k < n:
	res += 1
	k += 1
print(res)


s = str(input())
if s == '0':
	print(0)
	exit(0)
ls = []
if len(s) % 2 == 1:
	s = '0' + s
i = len(s) - 1
while i >= 0:
	ele = ord(s[i]) - 48 + (ord(s[i - 1]) - 48) * 2
	ls.append(ele)
	i -= 2
ls = ls[::-1]
ans = len(ls) - 1
if ls[0] > 1:
	ans += 1
else:
	ok = True
	for i in range(1, len(ls)):
		if ls[i] != 0:
			ok = False
	if ok == False:
		ans += 1
print(ans)


import math

def check_pow(N, k):
	if k < 0 or N < 0:
		raise ValueError('k and N must be greater than 0')
	if k == 0 and N == 1:
		return True
	if k in (0, 1) and N != 1:
		return False
	num = k
	while num < N:
		num *= k
	return num == N

def is_pow4(n):
	return n == '1' or n == '0' or (n.count('0') % 2 == 0 and n.count('1') == 1)
s = input()
if is_pow4(s):
	n = len(s) - 1
	print(math.ceil(n / 2))
else:
	n = len(s)
	print(math.ceil(n / 2))


num = int(str(input()), 2)
t = 4
ans = 0
i = 0
while num > t ** i:
	ans += 1
	i += 1
print(ans)


data = input()
number = int(data, 2)
for k in range(51):
	if 4 ** k >= number:
		print(k)
		break


binario = int(input(), base=2)
k = 0
while binario > 4 ** k:
	k += 1
print(k)


str = input()
k = len(str)
ans = 0
k = k - 1
for i in range(0, len(str)):
	if str[i] == '1':
		ans += 2 ** k
	k = k - 1
cnt = 0
i = 1
while i < ans:
	cnt = cnt + 1
	i = i * 4
print(cnt)


from collections import deque, Counter
import array
from itertools import combinations, permutations
from math import sqrt
import unittest

def read_int():
	return int(input().strip())

def read_int_array():
	return [int(i) for i in input().strip().split(' ')]
from math import log, ceil
s = input().strip()
n = len(s)
count = ceil(n / 2)
if not any((c for c in s[1:] if c == '1')) and n % 2 == 1:
	count -= 1
print(count)


s = input()
if s == '0' or s == '1':
	print('0')
elif s.count('0') == len(s) - 1 and s.count('0') % 2 == 0:
	print((len(s) - 1) // 2)
else:
	print((len(s) - 1) // 2 + 1)


def main():
	n = input()
	flag = True
	for i in range(1, len(n)):
		if n[i] == '1':
			flag = False
	if flag:
		print(len(n) // 2)
	else:
		print((len(n) + 1) // 2)
main()


s = input()
res = (len(s) - 1) // 2 + 1
if len(s) % 2 == 1 and s[1:].count('0') == len(s) - 1:
	res -= 1
print(res)


s = str(input())
num = 0
for i in range(len(s)):
	if s[i] == '1':
		num += pow(2, len(s) - i - 1)
val = 0
j = 0
while num > val:
	val = pow(4, j)
	j += 1
if s == '0':
	print(0)
else:
	print(j - 1)


s = input()
s = int(s, 2)
(count, current) = (0, 1)
while current < s:
	current *= 4
	count += 1
print(count)


n = input()
num = int(n, 2)
ans = 0
x = 1
while x < num:
	x *= 4
	ans += 1
print(ans)


s = int(input(), 2)
k = -1
while 4 ** (k + 1) < s:
	k += 1
print(k + 1)


import math
n = input()
x = int(n, 2)
res = 0
k = 0
while math.pow(4, k) < x:
	res += 1
	k += 1
print(res)


n = input()
sum = 0
for i in range(0, len(n)):
	sum += 2 ** (len(n) - 1 - i) * int(n[i])
resp = 0
i = 1
while i < sum:
	i = i * 4
	resp += 1
print(resp)


s = int(input(), 2)
if s == 1 or s == 0:
	print(0)
else:
	s -= 1
	s = bin(s)[2:]
	print(len(s) // 2 + len(s) % 2)


def bowow(s):
	(count, j, summa) = (0, 0, 0)
	for i in range(len(s)):
		if s[i] == '1' and summa == 0:
			count = j
			summa += 1
		elif s[i] == '1':
			summa += 1
	if len(s) == 1:
		return 0
	if summa == 1:
		return (len(s) - j - 2) // 2 + 1
	elif summa == 0:
		return 0
	return (len(s) - j - 1) // 2 + 1
print(bowow(input()))


import math
imo = int(input(), 2)
if imo == 0:
	imo = 1
num = int(math.log(imo, 4))
numex = 4 ** num
if imo > numex:
	num += 1
print(num)


def bi(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal
n = int(input())
n = bi(n)
k = c = 0
while n > 4 ** k:
	c += 1
	k += 1
print(c)


s = input()
x = len(s)
cnt = 0
for i in range(1, x):
	if s[i] == '1':
		cnt += 1
if cnt >= 1 and x % 2 == 1:
	print(x // 2 + 1)
else:
	print(x // 2)


import math
bin = input()
count_1 = bin.count('1')
if bin == '0':
	print('0')
elif count_1 == 1:
	missed = math.ceil((len(bin) - 1) / 2)
	print(str(missed))
else:
	missed = math.ceil(len(bin) / 2)
	print(str(missed))


from sys import stdin, stdout

def main():
	n = stdin.readline()
	a = '0b'
	binaryNo = a + str(n)
	number = int(binaryNo, 2)
	count = 0
	i = 1
	while i < number:
		if i < number:
			count += 1
		i = i * 4
	print(count)
main()


n = input()
l = len(n)
a = int(n)
r = 0
for i in range(0, l):
	r += a % 10 * 2 ** i
	a //= 10
(i, z) = (0, 0)
while 1:
	z = 4 ** i
	if z >= r:
		i -= 1
		break
	i += 1
print(i + 1)


s = input()
x = 1
for c in s[1:]:
	x *= 2
	if c == '1':
		x += 1
y = 1
i = 0
while y < x:
	y *= 4
	i += 1
print(i)


val = input()
add = 1 if len(val) % 2 == 1 else 0
if val.endswith('0' * (len(val) - 1)):
	add = 0
print(len(val) // 2 + add)


import math
s = input()
x = len(s) // 2
if len(s) % 2 == 1:
	for i in s[1:]:
		if i == '1':
			x += 1
			break
if s == '' or s == '0':
	x = 0
print(x)


x = input()
t = 0
k = 0
while len(x) > 1:
	y = x[-2:]
	if y != '00':
		t = t + 1
	x = x[:-2]
	k = k + 1
if (x == '1') & (t != 0):
	k = k + 1
print(k)


a = input()
b = str(a)
(c, d) = (1, 0)
b = b[::-1]
for i in b:
	if i == '1':
		d += c
	c = c * 2
cnt = 0
i = 1
while i < d:
	cnt += 1
	i *= 4
print(cnt)


def bod(n):
	return int(n, 2)
x = bod(str(input()))
j = 0
for i in range(50):
	if x > pow(4, i):
		j += 1
	else:
		break
print(j)


s = input('')
n = 0
m = 1
for i in range(len(s) - 1, -1, -1):
	n = n + int(s[i]) * m
	m = m * 2
res = 0
tmp = 1
while tmp < n:
	res = res + 1
	tmp = tmp * 4
print(res)


def f(a):
	a = int(a, 2)
	flag = True
	i = 0
	t = 0
	while flag:
		if 4 ** i < a:
			t += 1
		else:
			flag = False
		i += 1
	print(t)
n = input()
f(n)


x = int(input())
print((len(str(x - 1)) - 1) // 2 + (x > 1))


s = input()
v = int(s, 2)
index = 0
while v > 4 ** index:
	index += 1
print(index)


import sys
s = input()
flag = True
if s == '0' or s == '1':
	print(0)
	sys.exit()
if s == '10' or s == '11' or s == '100':
	print(1)
	sys.exit(0)
if s[0] == '1':
	c = 0
	for i in s[1:]:
		c += 1
		if i != '0':
			flag = False
			break
	if c % 2 != 0 and flag:
		flag = False
else:
	flag = False
if flag:
	print((len(s) - 1) // 2)
else:
	print((len(s) - 1) // 2 + 1)


s = input()
s = int(s, 2)
v = 0
i = 0
while True:
	v = pow(4, i)
	if v >= s:
		break
	else:
		i += 1
print(i)


import sys
input = lambda : sys.stdin.readline().strip()
from math import log
s = input()
if s == '0':
	print(0)
elif s == '1':
	print(0)
else:
	n = len(s)
	if int(s[1:]) == 0 and len(s) % 2:
		print((n + 1) // 2 - 1)
	else:
		print((n + 1) // 2)


import math
a = input()
number = 0
for i in a:
	if i == '1':
		number += 1
if a == '0':
	print(0)
	exit()
if number > 1:
	print(math.ceil(len(a) / 2))
else:
	print(math.ceil((len(a) - 1) / 2))


def binaryToDecimal(n):
	num = n
	dec_value = 0
	base1 = 1
	len1 = len(num)
	for i in range(len1 - 1, -1, -1):
		if num[i] == '1':
			dec_value += base1
		base1 = base1 * 2
	return dec_value
s = input()
n = binaryToDecimal(s)
i = 0
while True:
	p = int(pow(4, i))
	if p >= n:
		break
	i += 1
print(i)


s = int(input())
s_t = 1
ans = 0
while s_t < s:
	ans += 1
	s_t *= 100
print(ans)


from math import log
a = int(input(), 2)
for i in range(51):
	if 4 ** i >= a:
		print(i)
		break


from math import log, floor

def bin2int(string):
	ans = 0
	power = 1
	for i in reversed(string):
		ans += int(i) * power
		power *= 2
	return ans

def solve(input_data):
	num = bin2int(input_data)
	if num == 0:
		return 0
	k = floor(log(num, 4))
	return k + (4 ** k < num)

def test_solve():
	assert solve('100000000') == 4
	assert solve('101') == 2
	assert solve('10100') == 3
	assert solve('100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001') == 50
print(solve(input().strip()))


binary = input()
decimal = 0
for digit in binary:
	decimal = decimal * 2 + int(digit)
k = 1
result = 0
while k < decimal:
	k *= 4
	result += 1
print(result)


i = int(input())
a = 1
dem = 1
while a < i:
	a = a * 10
	dem = dem + 1
print(dem // 2)


x = int(input(), 2)
sum = 0
i = 0
count = 0
while True:
	sum = int(pow(4, i))
	i += 1
	if sum >= x:
		break
	else:
		count += 1
print(count)


s = input()
res = len(s) // 2
if len(s) % 2 == 1:
	for c in s[1:]:
		if c == '1':
			res += 1
			break
print(res)


a = int(input(), base=2)
c = 0
while 4 ** c < a:
	c += 1
print(c)


valor_binario = input()
valor_decimal = int(valor_binario, 2)
valor_atual = 0
k = 0
resposta = 0
while valor_atual < valor_decimal:
	valor_atual = 4 ** k
	if valor_atual < valor_decimal:
		k = k + 1
		resposta = resposta + 1
print(resposta)


def two(a):
	n = 0
	for i in range(len(a)):
		if int(a[i]) == 1:
			n += 2 ** (len(a) - 1 - i)
	return n

def four(a):
	v = 0
	k = 1
	while 4 ** v < a:
		v += 1
		k += 1
	k -= 1
	return k
s = input()
n = two(s)
print(four(n))


a = input()
zero = 0
one = 0
for i in a:
	if i == '1':
		one += 1
	else:
		zero += 1
ans = (one + zero - 1) // 2 + 1
if one == 0:
	print(0)
elif one == 1 and zero % 2 == 0:
	print(ans - 1)
else:
	print(ans)


sBin = input()
try:
	sDec = int(sBin, 2)
except:
	sDec = None
while sDec == None or (0 <= sDec < 2 ** 100) == False:
	sBin = input()
	try:
		sDec = int(sBin, 2)
	except:
		sDec = None
k = 0
while True:
	t = 4 ** k
	if t >= sDec:
		break
	k += 1
print(k)


n = input()
if n == '0':
	print(0)
else:
	num = int(n, 2)
	pow2_max = len(n) - n.index('1') - 1
	count = pow2_max // 2 + 1
	k = count
	while True:
		if 4 ** k < num:
			count += 1
		else:
			break
	if pow2_max % 2 == 0:
		if n.count('0') == len(n) - 1:
			count -= 1
	print(count)


s = int(input())
n = int(str(s), 2)
i = 0
while 4 ** i < n:
	i += 1
print(i)


b_num = input()
value = 0
for i in range(len(b_num)):
	digit = b_num[i]
	if digit == '1':
		value = value + pow(2, len(b_num) - 1 - i)
i = 0
ans = 0
while value > pow(4, i):
	ans = ans + 1
	i = i + 1
print(ans)


(s, a) = (int(input(), 2), 0)
while 4 ** a < s:
	a += 1
print(a)


def binaryToDecimal(n):
	num = n
	dec_value = 0
	base1 = 1
	len1 = len(num)
	for i in range(len1 - 1, -1, -1):
		if num[i] == '1':
			dec_value += base1
		base1 = base1 * 2
	return dec_value
s = input()
num = binaryToDecimal(s)
i = 0
while 4 ** i < num:
	i += 1
print(i)


import math
line = int(input(), 2)
i = 1
res = 0
if line == 0:
	print('0')
else:
	while i < line:
		i *= 4
		res += 1
	print(int(res))


s = input()
num = int(s, 2)
count = 0
for i in range(51):
	if 4 ** i < num:
		count += 1
print(count)


s = input()
a = int(s, 2)
b = 1
ans = 0
while b < a:
	ans = ans + 1
	b = b * 4
print(ans)


a = int(input(), 2)
ans = 0
for i in range(0, 100):
	if 4 ** i < a:
		ans += 1
print(ans)


from math import *
flag = 0
n = input()
if int(n) == 0:
	flag = 1
n = list(n)
s = 0
p = 1
count = 0
for i in range(len(n)):
	if flag == 1:
		break
	s += 2 ** (len(n) - i - 1) * int(n[i])
while 1:
	if p >= s:
		break
	p *= 4
	count += 1
print(count)


n = str(input())
n = int(n, 2)
res = 0
for j in range(100000):
	b = 4 ** j
	if b < n:
		res += 1
	else:
		break
print(res)


L = list(input())
X = len(L)
if X == 1:
	print(0)
else:
	FLAG = 0
	for i in range(1, X):
		if L[i] == '1':
			FLAG = 1
			break
	if FLAG == 1 and X % 2 != 0:
		print(X // 2 + 1)
	else:
		print(X // 2)


n = int(input(), 2)
j = 0
ans = 0
while 4 ** j < n:
	ans += 1
	j += 1
print(ans)


def isPowerOfFour(n):
	count = 0
	if n and (not n & n - 1):
		while n > 1:
			n >>= 1
			count += 1
		if count % 2 == 0:
			return True
		else:
			return False
s = int(input(), 2)
t = 0
flag = 0
if isPowerOfFour(s):
	flag = 1
while s > 0:
	s = s >> 2
	t = t + 1
if flag == 1:
	t = t - flag
print(t)


s = int(input(), 2)
s = int(s)
power = 0
count = 0
while 4 ** power < s:
	count += 1
	power += 1
print(count)


n = int(input())
j = 1
c = 0
while j < n:
	j *= 100
	c += 1
print(c)


s = input()
l = len(s)
ans = int((l + 1) / 2)
if l % 2 and list(s).count('1') <= 1:
	ans -= 1
print(ans)


def binaryToDecimal(n):
	return int(n, 2)
val = input()
x = binaryToDecimal(val)
i = 0
while 1:
	z = pow(4, i)
	if z >= x:
		print(i)
		break
	else:
		i = i + 1


x = input()
y = x[::-1]
z = 0
m = 1
e = 0
while z < len(x):
	if y[z] == '1':
		e += m
	m = m * 2
	z += 1
z = 0
k = 4
while True:
	if k ** z >= e:
		f = z
		break
	z += 1
print(f)


a = input()
otv = int(len(a) / 2)
if len(a) % 2:
	if a.count('1') > 1:
		otv += 1
print(otv)


inp = input()
inp = inp[::-1]
isPower = True
power = -1
for (index, digit) in enumerate(inp):
	if digit == '1':
		if power != -1:
			isPower = False
		power = index
if isPower:
	print((power - 1) // 2 + 1)
else:
	print(power // 2 + 1)


s = input()
log2s = len(s) - ('1' not in s[1:])
print((log2s + 1) // 2)


import math
n = input()
a = int(n, 2)
ans = 0
for i in range(100):
	if 4 ** i < a:
		ans += 1
	else:
		break
print(ans)


def BtoD(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal
num = BtoD(int(input()))
a = [1, 4, 16, 64, 256, 1024, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456, 1073741824, 4294967296, 17179869184, 68719476736, 274877906944, 1099511627776, 4398046511104, 17592186044416, 70368744177664, 281474976710656, 1125899906842624, 4503599627370496, 18014398509481984, 72057594037927936, 288230376151711744, 1152921504606846976, 4611686018427387904, 18446744073709551616, 73786976294838206464, 295147905179352825856, 1180591620717411303424, 4722366482869645213696, 18889465931478580854784, 75557863725914323419136, 302231454903657293676544, 1208925819614629174706176, 4835703278458516698824704, 19342813113834066795298816, 77371252455336267181195264, 309485009821345068724781056, 1237940039285380274899124224, 4951760157141521099596496896, 19807040628566084398385987584, 79228162514264337593543950336, 316912650057057350374175801344, 1267650600228229401496703205376]
for i in range(len(a)):
	if a[i] >= num:
		print(i)
		break


def bi(binary):
	binary2 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal

def cou(d):
	count = 0
	ct = 1
	while ct < d:
		ct = ct * 4
		count = count + 1
	return count
q = int(input())
f = bi(q)
print(cou(f))


s = input()
onlyone = True
for x in s[1:]:
	if x == '1':
		onlyone = False
ans = (len(s) - 1) // 2
if not onlyone or (len(s) - 1) % 2 != 0:
	ans += 1
print(ans)


a = input()
if a == '0' or a == '1':
	print(0)
else:
	if len(a) % 2 != 0:
		a = '0' + a
	count = 0
	for i in range(2, len(a)):
		count += int(a[i])
	b = a[0] + a[1]
	res = len(a) // 2 - 1
	if count == 0 and b == '01':
		print(res)
	else:
		print(res + 1)


arrive = int(input(), 2)
time = 0
trains = 0
while arrive > 4 ** trains:
	trains += 1
print(trains)


num = int(input(), 2)
count = 1
if num > 0:
	for i in range(num + 1):
		if num > 2 ** i:
			count += 1
		else:
			break
print(count // 2)


y = input()
c = 0
i = 0
x = 0
t = len(y) - 1
yahia = 0
ll = 0
while t >= 0:
	x += int(y[t]) * 2 ** i
	i += 1
	t -= 1
while x > ll:
	ll = 4 ** yahia
	yahia += 1
	if ll < x:
		c += 1
	elif x <= 0:
		break
print(c)


from math import log
s = input().rstrip()
if len(s) <= 1:
	print(0)
elif len(s) == 2:
	print(1)
elif len(s) % 2 == 1:
	print((len(s) - 1) // 2 + int(any(map(int, s[1:]))))
else:
	print(len(s) // 2)


s = list(input())
value = 0
for i in range(len(s)):
	digit = s.pop()
	if digit == '1':
		value = value + pow(2, i)
i = 0
k = 4
while 1:
	k = pow(4, i)
	if value <= k:
		print(i)
		break
	i += 1


a = 1
b = int(input())
Ans = 0
while a <= b:
	if a < b:
		Ans = Ans + 1
	a = a * 100
print(Ans)


s = input()
n = int(s, 2)
cnt = 0
four = 1
while True:
	if four < n:
		cnt += 1
		four = four << 2
	else:
		break
print(cnt)


s = input()
a = 0
sum = 0
for i in s[::-1]:
	sum += int(i) * 2 ** a
	a += 1
p = 0
d = 0
while 4 ** p < sum:
	d += 1
	p += 1
print(d)


from math import log, ceil
number = str(input())
result = ceil(len(number) / 2)
todas = True
for (index, wea) in enumerate(number):
	if index == 0:
		continue
	else:
		todas = todas and wea == '0'
if todas and (len(number) - 1) % 2 == 0:
	result -= 1
print(result)


t = input()
time = len(t)
c = 0
total = 1
for i in t:
	if i == '1':
		c += 1
time = time - 1
if t == '1' or t == '0':
	print(0)
elif time % 2 == 0:
	if c == 1:
		print(total + time // 2 - 1)
	else:
		print(total + time // 2)
else:
	print(total + time // 2)


S = list(map(int, input().strip()))
L = len(S)
if not any((s == 1 for s in S[1:])):
	print(L // 2)
else:
	print(-(-L // 2))


from decimal import Context, Decimal
current_time = int(input(), 2) - 1
if current_time <= 0:
	print(0)
else:
	context = Context(prec=70)
	num = Decimal(current_time)
	four = Decimal(4)
	ans = context.divide(num.ln(context), four.ln(context))
	print(int(ans) + 1)


a = input()
c = a[::-1]
if int(c) == 0:
	print('0')
elif int(c) == 1 and len(a) % 2 == 1:
	print(str(len(a) // 2))
else:
	print(str((len(a) + 1) // 2))


n = int(input())
decimal = 0

def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal
count = 0
a = binaryToDecimal(n)
for i in range(0, 51):
	amol = 4 ** i
	if amol < a:
		count += 1
	else:
		print(count)
		break


import math

def main():
	string = str(input())
	cnt = 0
	if string == '0':
		print(0)
		return
	for i in range(len(string)):
		if string[i] == '1':
			cnt += 1
	if cnt == 1:
		print(math.ceil((len(string) - 1) / 2))
	else:
		print(math.ceil(len(string) / 2))
main()


s = input()
n = len(s)
if s == '0':
	print(0)
elif n % 2 == 0:
	print((n + 1) // 2)
else:
	flg = 0
	for i in range(1, n):
		if s[i] == '1':
			flg = 1
	if flg == 1:
		print((n + 1) // 2)
	else:
		print(n // 2)


s = int(input(), 2)
ans = 0
cur = 1
while s > cur:
	ans += 1
	cur *= 4
print(ans)


s = str(input())

def binaryToDecimal(n):
	return int(n, 2)
a = binaryToDecimal(s)
if a == 1:
	print(0)
else:
	ans = 0
	k = 0
	b = 0
	while b < a:
		k = k + 1
		ans = ans + 1
		b = 4 ** k
	print(ans)


time = int(input(), base=2)
res = 0
while 4 ** res < time:
	res += 1
print(res)


x = int(str(input()), 2)
ans = 0
temp = 1
if x > 1:
	ans = 1
while temp * 4 < x:
	temp = temp * 4
	ans = ans + 1
print(ans)


s = input()
n = len(s)
c = s.count('1')
if c is 0:
	print(0)
elif n % 2 is 0:
	print(n // 2)
elif n % 2 is 1:
	if c == 1:
		print(n // 2)
	else:
		print(n // 2 + 1)


s = int(input(), 2)
n = 1
cnt = 0
while n < s:
	cnt += 1
	n *= 4
print(cnt)


binary = input()
s = int(binary, 2)
if s == 0:
	i = 0
else:
	for i in range(s):
		x = pow(4, i)
		if x >= s:
			break
		else:
			continue
print(i)


def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal
n = int(input())
d = binaryToDecimal(n)
for i in range(51):
	if 4 ** i >= d:
		print(i)
		break


b = input()
d = int(b, 2)
i = 0
while True:
	pow = 1
	pow = 4 ** i
	i = i + 1
	if pow >= d:
		print(i - 1)
		break


def dec(n, l):
	s = 0
	i = 0
	while l >= 0:
		s = s + int(n[i]) * 2 ** l
		l = l - 1
		i = i + 1
	return s

def bow(n):
	i = 0
	while 4 ** i < n:
		i = i + 1
	return i
n = input()
print(bow(dec(n, len(n) - 1)))


import os
import sys
from io import BytesIO, IOBase

def solution(s):
	n = int(s, 2)
	(res, k) = (0, 0)
	while 4 ** k < n:
		res += 1
		k += 1
	write(res)

def main():
	s = input()
	solution(s)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())

def w_array(arr):
	for x in arr:
		write(x, end=' ')
	write()
main()


st = int(str(input()), 2)
arr = 4 ** 0
cnt = 0
while st > arr:
	cnt += 1
	arr = 4 ** cnt
print(cnt)


n = int(str(input()), 2)
c = 0
for i in range(100000):
	p = 4 ** i
	if p < n:
		c += 1
	else:
		break
print(c)


l = input()
ch = l[::-1]
s = 0
for i in range(len(ch)):
	s += 2 ** i * int(ch[i])
k = 0
while 4 ** k < s:
	k += 1
print(k)


s = input()
flag = '1' in s[1:]
if len(s) % 2 == 1 and (not flag):
	print(len(s) // 2)
else:
	print((len(s) + 1) // 2)


a = int(input(), 2)
c = 0
for i in range(0, 100):
	if a > pow(4, i):
		c = c + 1
print(c)


a = input()
b = list(a)
lst = b[::-1]
i = 0
r = 0
k = 0
o = 0
z = len(lst)
while i < z:
	t = 0
	t = int(lst[i]) * pow(2, i)
	r = r + t
	i = i + 1
while k <= 1000000:
	d = pow(4, k)
	if d < r:
		o = o + 1
	else:
		break
	k = k + 1
print(o)


import math
i = int(input(), 2)
if i == 0:
	print(0)
else:
	x = math.log(i, 4)
	if 4 ** int(x) < i:
		x += 1
	print(int(x))


s = input()
n = int(s, 2)
ct = 0
for i in range(52):
	if 4 ** i >= n:
		break
	else:
		ct += 1
print(ct)


s = input()
a = int(s, 2)
c = 0
if a == 0:
	print(0)
	exit()
b = a
lst = []
while a > 0:
	a = a // 4
	c = c + 1
for i in range(c):
	lst.append(4 ** i)
if lst[len(lst) - 1] == b:
	print(len(lst) - 1)
else:
	print(len(lst))


s = input()
ans = 0
mus = 0
for i in range(len(s)):
	mus += 2 ** (len(s) - i - 1) * (ord(s[i]) - ord('0'))
cur = 1
while cur < mus:
	ans += 1
	cur *= 4
print(ans)


import math
s = input()
ans = math.ceil(len(s) / 2)
n = int(s, 2)
while n % 4 == 0 and n != 1 and (n != 0):
	n //= 4
if n == 1 or n == 0:
	ans -= 1
print(ans)


s = input()
ss = int(s, 2)
f = 1
count = 0
while f < ss:
	f = f * 4
	count = count + 1
print(count)


s = input()
ans = 0

def f(x):
	return x[::-1]
s = f(s)
for i in range(0, len(s)):
	if s[i] == '1':
		ans += 2 ** i
result = 0
for i in range(0, 51):
	if 4 ** i < ans:
		result += 1
	else:
		break
print(result)


s = input()
s = s[::-1]
sum = 0
for (i, j) in enumerate(s):
	sum = sum + int(j) * 2 ** int(i)
cnt = 0
while 4 ** cnt < sum:
	cnt += 1
print(cnt)


s = str(input())
b = int(s, 2)
i = 0
cnt = 0
while 4 ** i < b:
	cnt += 1
	i += 1
print(cnt)


import sys
from collections import OrderedDict
from itertools import groupby, product
Lines = []
for Line in sys.stdin:
	Lines.append(Line.rstrip('\n'))
n = Lines[0]
b = n[1:]
if len(b) == 1:
	c = 1
else:
	c = len(b) // 2
	if '1' in b:
		c = c + 1
	elif len(b) % 2 == 1:
		c = c + 1
print(c)


a = input()
n = len(a)
num = 0
p = 1
for i in range(n):
	val = ord(a[n - i - 1]) - ord('0')
	num += p * val
	p *= 2
ans = 0
num -= 1
while num > 0:
	ans += 1
	num //= 4
print(ans)


def reverse(s):
	if len(s) == 0:
		return s
	else:
		return reverse(s[1:]) + s[0]

def solve(s):
	l = len(s)
	s = reverse(s)
	num = 0
	for i in range(l):
		if s[i] == '1':
			num = num + pow(2, i)
	check = 1
	count = 0
	while check <= num:
		check = check * 4
		count = count + 1
	if check == num * 4:
		count = count - 1
	print(count)
s = input()
solve(s)


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_int = lambda : int(sys.stdin.readline())
n = get_string()
n = int(n, 2)
if n > 0:
	p = math.log(n, 4)
	p = math.ceil(p)
	if 4 ** p < n:
		p = p + 1
	print(p)
else:
	print(0)


import sys

def b2d(inp):
	out = 1
	for c in inp:
		out = out * 2
		if c == '1':
			out = out + 1
	return out
inp = sys.stdin.readline().strip()[1:]
time = b2d(inp)
exp = 1
count = 0
last = 1
while last < time:
	last = last * 4
	count = count + 1
print(count)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def main():
	t = 1
	rr = []
	for _ in range(t):
		s = S()
		r = 0
		if len(s) > 1:
			r = (len(s) + 1) // 2
			if len(s) % 2 == 1 and s == '1' + '0' * (len(s) - 1):
				r -= 1
		rr.append(r)
	return JA(rr, '\n')
print(main())


s = input()
zeros = True
if len(s) == 1:
	print('0')
elif len(s) == 2:
	print('1')
else:
	missed = (len(s) + 1) // 2
	for i in range(1, len(s)):
		if int(s[i]) != 0:
			zeros = False
	if int(s[0]) == 1 and zeros and (len(s) % 2 != 0):
		print(missed - 1)
	else:
		print(missed)


binary = input()
answer = 1 + int((len(binary) - 1) / 2)
if binary == '0' or binary == '1':
	answer = 0
elif len(binary) % 2 == 1 and int(binary[1:]) == 0:
	answer -= 1
print(answer)


s = input()
r = 0
for i in s:
	if i == '1':
		r += 1
ans = 0
ans += len(s)
if r == 1:
	ans -= 1
elif r == 0:
	ans -= 1
ans = (ans + 1) // 2
print(ans)


a = input()
b = 0
for i in range(0, len(a)):
	if a[i] == '1':
		b += 2 ** (len(a) - i - 1)
i = 0
while 4 ** i < b:
	i += 1
print(i)


n = input()
n = int(n, 2)
start = 1
c = 0
while start < n:
	c += 1
	start *= 4
print(c)


s = input()
l = len(s)
ans = l // 2
if l % 2 == 1 and '1' in s[1:]:
	ans += 1
if s == '0':
	print(0)
else:
	print(ans)


binary = int(input())
binary1 = binary
(decimal, i, n) = (0, 0, 0)
while binary != 0:
	dec = binary % 10
	decimal = decimal + dec * pow(2, i)
	binary = binary // 10
	i += 1
i = 0
count = 0
while True:
	if pow(4, i) < decimal:
		count = count + 1
	else:
		break
	i = i + 1
print(count)


n = int(input(), 2)
r = 1
k = 0
while r < n:
	r *= 4
	k += 1
print(k)


def check(s):
	for i in range(len(s)):
		if s[i] == '1' and i != 0:
			return True
	return False
s = input()
res = int(len(s) / 2)
if len(s) % 2 == 1 and check(s):
	res += 1
print(res)


import sys
import math
input = sys.stdin.readline
n = int(input().strip(), 2)
(x, ans) = (1, 0)
while x < n:
	ans += 1
	x *= 4
print(ans)


S = input('')
B = int(S, 2)
K = 1
N = 0
while K < B:
	K = K * 4
	N = N + 1
print(N)


s = int(input(), 2)
miss = 0
i = 1
while i < s:
	miss += 1
	i *= 4
print(miss)


s = input()[::-1]
u = 0
count = 0
for i in s:
	if i == '1':
		count += 1
		ans = u
	u += 1
u -= 1
if count == 0:
	print(0)
elif count == 1:
	if u % 2 != 0:
		print(u // 2 + 1)
	else:
		print(u // 2)
else:
	print(u // 2 + 1)


s = input()
n = len(s)
a = n // 2
if n & 1:
	a += s[1:].count('1') != 0
print(a)


def bs(val):
	(l, r) = (-1, 100)
	while r - l > 1:
		m = (r + l) // 2
		if 4 ** m < x:
			l = m
		else:
			r = m
	return r
s = input()
x = int(s, 2)
p = bs(x)
print(p)


import math
s = input()
if int(s) != 0:
	decimalvalue = int(s, 2)
	x = int(math.log(decimalvalue, 4.0))
	l = int(math.pow(4, x))
	if decimalvalue - l <= 0:
		print(x)
	else:
		print(x + 1)
else:
	print(0)


b = input()
l = len(b)
dec = 0
for i in range(l):
	dec += int(b[i]) * 2 ** (l - i - 1)
if int(b) == 0:
	print(0)
elif int(4 ** ((l - 1) // 2)) == dec:
	print(i // 2)
else:
	print(i // 2 + 1)


s = input()
s = int(s, 2)
k = 0
while True:
	a = pow(4, k)
	if a < s:
		k += 1
	else:
		break
print(k)


s = input()
f = 0
for i in s:
	f = f * 2 + int(i)
ans = 0
for i in range(101):
	if 4 ** i < f:
		ans += 1
print(ans)


import math
s = input()
n = int(s, 2)
n -= 1
if n <= 0:
	print(0)
else:
	print((len(bin(n)) - 1) // 2)


import math as m

def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal
t = int(input())
if t == 0:
	print(0)
else:
	T = binaryToDecimal(t)
	num = int(m.log2(T) / m.log2(4))
	c = 0
	for i in range(0, num + 1):
		if 4 ** i < T:
			c = c + 1
	print(c)


strr = input()
lenn = len(strr)
count = 0
for i in strr:
	if i == '1':
		count += 1
	if count > 1:
		break
if int((lenn - 1) / 2) == (lenn - 1) / 2:
	if count > 1:
		print(int((lenn - 1) / 2) + 1)
	else:
		print(int((lenn - 1) / 2))
else:
	print(int((lenn - 1) / 2) + 1)


s = input()
x = int(len(s) / 2)
if len(s) % 2 == 0:
	print(x)
elif s.count('1') > 1:
	print(x + 1)
else:
	print(x)


s = input()
sum = 0
for i in range(0, len(s)):
	sum += int(s[len(s) - 1 - i]) * 2 ** i
k = 0
count = 0
while True:
	if 4 ** k < sum:
		count += 1
	else:
		break
	k += 1
print(count)


import math
s = list(input())
if s[0] == '0':
	print(0)
elif s.count('0') == len(s) - 1:
	print(math.ceil(s.count('0') / 2))
else:
	print(math.ceil(len(s) / 2))


s = input().strip()
if len(s) == 1:
	print(0)
	exit(0)
s = s[::-1]
n = len(s)
ans = 0
for i in range(0, n, 2):
	ans += 1
if n % 2:
	if s.index('1') == n - 1:
		ans -= 1
print(ans)


import math

def tobase10(b_str):
	f = 0
	l = len(b_str)
	for i in range(l):
		if b_str[i] == '1':
			f += 2 ** (l - i - 1)
	return f
n = input()
if n == '0' or n == '1':
	print(0)
else:
	g = tobase10(n)
	x = int(math.log(g, 4))
	y = 4 ** x
	if y < g:
		print(x + 1)
	else:
		print(x)


s = input()
if len(s) == 1:
	print(0)
elif len(s) == 2:
	print(1)
else:
	ans = len(s) // 2 + len(s) % 2
	count = 0
	for item in s:
		if item == '0':
			count += 1
	if s[0] == '1' and count == len(s) - 1 and (len(s) % 2 != 0):
		ans -= 1
	print(ans)


cnt = 0
total = 0
a = list(input())
for i in range(len(a) - 1, -1, -1):
	if a[i] == '0':
		cnt += 1
	elif a[i] == '1':
		total += 2 ** cnt
		cnt += 1
count = 1
temp = 0
temp += total
flag = False
k = 0
if total > 1:
	while 4 ** k < total:
		count = 4 ** k
		k += 1
print(k)


s = input()
if len(s) % 2 == 1:
	s = '0' + s
helper = {'00': '0', '01': '1', '10': '2', '11': '3'}
new = ''
for i in range(0, len(s), 2):
	new += helper[s[i:i + 2]]
ans = len(new)
if new[1:] == '0' * (ans - 1) and (new[0] == '1' or new[0] == '0'):
	ans -= 1
print(ans)


s = input()
f = 0
if '1' in s[1:]:
	f = 1
if len(s) % 2 == 0:
	f = 0
print(len(s) // 2 + f)


a1 = input()
a = []
for i in a1:
	a.append(i)
q = len(a) - 1
a.remove(a[0])
if '1' in a or q % 2 == 1:
	print(q // 2 + 1)
else:
	print(q // 2)


import math
s = list(input())
count = 0
flag = 0
for i in range(len(s)):
	if i == '1':
		count = i
		break
for i in range(count + 1, len(s)):
	if s[i] == '1':
		flag = 1
		break
count = len(s) - count
if flag == 1:
	count += 1
count //= 2
print(count)


import math
s = input()
if len(s) == 1 and s[0] == '0':
	print(0)
elif (len(s) - 1) % 2 == 0:
	if s.count('1') == 1:
		print((len(s) - 1) // 2)
	else:
		print((len(s) - 1) // 2 + 1)
else:
	print((len(s) - 1) // 2 + 1)


s = input()
if s == '0':
	print(0)
elif s == '1':
	print(0)
elif s == '10':
	print(1)
elif s == '11':
	print(1)
elif len(s) % 2 != 0:
	if s.count('1') != 1:
		print((len(s) - 1) // 2 + 1)
	else:
		print((len(s) - 1) // 2)
else:
	print((len(s) - 1) // 2 + 1)


import math
import sys
import collections

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)
s = input()
t = len(s)
if '1' not in s[1:] and (t - 1) % 2 == 0:
	print((t - 1) // 2)
else:
	print((t - 1) // 2 + 1)


n = int(input(), 2)
c = 0
j = 0
while n > 4 ** c:
	j = j + 1
	c = c + 1
print(j)


s = input()

def power(x, y):
	if y == 0:
		return 1
	elif int(y % 2) == 0:
		return power(x, int(y / 2)) * power(x, int(y / 2))
	else:
		return x * power(x, int(y / 2)) * power(x, int(y / 2))

def binaryToDecimal(n):
	num = n
	dec_value = 0
	base1 = 1
	len1 = len(num)
	for i in range(len1 - 1, -1, -1):
		if num[i] == '1':
			dec_value += base1
		base1 = base1 * 2
	return dec_value
x = binaryToDecimal(s)
i = 0
cnt = 0
while 1:
	z = power(4, i)
	if x > z:
		cnt = cnt + 1
		i = i + 1
	else:
		break
print(cnt)


x = input()
a = 0
for i in range(len(x)):
	a *= 2
	if x[-i] == '1':
		a += 1
ans = 0
x = 1
while x < a:
	ans += 1
	x *= 4
print(ans)


n = int(input(), 2)
f = 1
c = 0
while f < n:
	c += 1
	f *= 4
print(c)


import collections
n = input()
m = n[::-1]
s = 0
for i in range(0, len(m)):
	if m[i] == '1':
		s += 2 ** i
i = 0
ans = 0
while 4 ** i < s:
	ans += 1
	i += 1
print(ans)


s = input()
s = s[::-1]
num = 0
for i in range(len(s)):
	if s[i] == '1':
		num = num + pow(2, i)
ans = 0
x = 0
while pow(4, x) < num:
	ans = ans + 1
	x = x + 1
print(ans)


import math
n = input()
c = 0
for i in range(1, len(n)):
	if n[i] == '1':
		c = 1
		break
if c:
	print(math.ceil(len(n) / 2))
else:
	print(len(n) // 2)


n = input()
if n == '0':
	print(0)
	exit()
l = len(n)
missed = l // 2
if l % 2 and n.count('1') != 1:
	missed += 1
print(missed)


time = int(input())
cur = 0
pow = 1
while time > 0:
	if time % 10 == 1:
		cur += pow
	pow *= 2
	time //= 10
time = cur
ans = 0
cur = 1
while cur < time:
	ans += 1
	cur *= 4
print(ans)


inputedNumber = int(input(), 2)
count = 0
mult = 1
while mult < inputedNumber:
	mult = mult * 4
	count = count + 1
print(count)


n = int(input(), base=2)
cnt = 0
i = 1
while True:
	if i >= n:
		break
	i = i * 4
	cnt += 1
print(cnt)


import math
s = int(input(), 2)
i = 0
while i < 50:
	if math.pow(4, i) >= s:
		break
	i += 1
print(i)


s = input()
s = list(map(lambda x: x == '1', s))
print(len(s) // 2 + (any(s[1:]) and len(s) % 2 == 1))


s = input()
n = len(s)
if s == '0':
	print(0)
	exit()
ones = 0
for ch in s:
	if ch == '1':
		ones += 1
ans = (n + 1) // 2
if n % 2 == 1 and ones == 1:
	ans -= 1
print(ans)


from math import ceil, log
b = input()
if b == '0':
	print(0)
elif b.find('1') == b.rfind('1'):
	print(ceil(log(int(b, 2), 4)))
else:
	print(ceil((len(b) - 2) / 2) + 1)


a = input()
k = a.count('0')
t = len(a)
if t > 2 and t % 2 != 0:
	if k == t - 1:
		print((t - 1) // 2)
	else:
		print((t - 1) // 2 + 1)
elif t > 2 and t % 2 == 0:
	print((t - 1) // 2 + 1)
elif t == 2:
	print('1')
else:
	print('0')


binaryInput = input()
decimalInput = int('0b' + binaryInput, 2)
i = 0
counter = 0
while 4 ** i < decimalInput:
	counter += 1
	i += 1
print(counter)


a = input()
i = len(a) - 1
cnt = 0
j = 0
for j in range(len(a)):
	if a[j] == '1':
		cnt += i
		break
	i -= 1
if a[j + 1:].count('1') or cnt % 2:
	print(cnt // 2 + 1)
else:
	print(cnt // 2)


s = input()
l = len(s) // 2
if len(s) % 2 == 1:
	l += 1
b = 1
for i in range(1, len(s)):
	if s[i] == '1':
		b = 0
if b and len(s) % 2 == 1:
	print(l - 1)
else:
	print(l)


x = input()
xd = int(x, 2)
power = 0
counter = 0
while 4 ** power < xd:
	power += 1
	counter += 1
print(counter)


max_time = 2 ** 100
s = int(input(), 2)
(start, count) = (1, 0)
while start < s:
	count += 1
	start *= 4
print(count)


from sys import stdin
import math
r = stdin.readline

def bin_to_int(binr):
	binr = binr[::-1]
	ans = 0
	for i in range(len(binr)):
		if binr[i] == '1':
			ans += 2 ** i
	return ans

def main():
	binr = r().strip()
	num = bin_to_int(binr)
	(ac, ans) = (1, 0)
	while ac < num:
		ac *= 4
		ans += 1
	print(ans)
main()


n = int(input())
res = 0
a = '1'
while n > int(a):
	res += 1
	a += '00'
print(res)


import math
num = input('')
dec_num = '0b' + num
dec_num = int(dec_num, 2)
x = math.ceil(len(num) / 2)
if 4 ** (x - 1) < dec_num:
	print(x)
else:
	print(x - 1)


s = input()
ans = (len(s) - 1) // 2
add = False
for i in range(1, len(s)):
	if s[i] == '1':
		add = True
if add or len(s) % 2 == 0:
	ans += 1
print(ans)


s = input()
binary = 0
ex = len(s) - 1
for i in range(len(s)):
	if s[i] == '1':
		binary = binary + int(pow(2, ex))
		ex = ex - 1
k = 0
while int(pow(4, k)) < binary:
	k = k + 1
print(k)


x = input()

def binaryToDecimal(n):
	return int(n, 2)
num = binaryToDecimal(x)
count = 1
n = 4
if num == 2 or num == 3 or num == 4:
	print(1)
elif num == 1 or num == 0:
	print(0)
elif num > 4:
	while num > n:
		n = n * 4
		count += 1
	print(count)


n_base2 = input()
n_base4 = []
if len(n_base2) % 2:
	n_base2 = '0' + n_base2
i = 0
zero_count = 0
while i < len(n_base2):
	if n_base2[i] == '0' and n_base2[i + 1] == '0':
		n_base4.append(0)
		zero_count += 1
	if n_base2[i] == '0' and n_base2[i + 1] == '1':
		n_base4.append(1)
	if n_base2[i] == '1' and n_base2[i + 1] == '0':
		n_base4.append(2)
	if n_base2[i] == '1' and n_base2[i + 1] == '1':
		n_base4.append(3)
	i += 2
if n_base2 == '00':
	print('0')
elif zero_count == len(n_base4) - 1 and n_base4[0] == 1:
	print(len(n_base4) - 1)
else:
	print(len(n_base4))


s = input()
n = int(s, 2)
value = 1
count = 0
if value < n:
	count += 1
while value << 2 < n:
	value = value << 2
	count += 1
print(count)


s = input()
if '1' in s:
	if s.count('1') == 1:
		print(int(len(s) / 2))
		exit()
	if len(s) % 2 == 1:
		print(int(len(s) / 2) + 1)
	else:
		print(int(len(s) / 2))
else:
	print(0)


s = int(input(), 2)
x = 1
ans = 0
while True:
	if x >= s:
		break
	ans += 1
	x *= 4
print(ans)


n = int(input(), 2)
a = [1]
for i in range(200):
	a.append(a[-1] * 4)
for i in range(200):
	if a[i] >= n:
		print(i)
		break


n = list(map(int, input()))
c = len(n)
d = 0
if sum(n) > 1 and c % 2 == 1:
	d += 1
print(c // 2 + d)


x = input()
flag = False
for i in range(1, len(x)):
	if x[i] == '1':
		flag = True
if flag and len(x) % 2 == 1:
	print(len(x) // 2 + 1)
else:
	print(len(x) // 2)


import math
s = input()
y = math.floor(len(s) / 2.0)
cnt = 0
for i in s:
	if i == '1':
		cnt += 1
if len(s) == 2 * y + 1 and cnt >= 2:
	y += 1
print(y)


s = input()
s = s[::-1]
a = 0
i = 0
for x in s:
	if x == '1':
		a += 2 ** i
	i += 1
k = 0
while 4 ** k < a:
	k += 1
print(k)


var = int(input(), 2)
ct = 0
i = 0
while 1:
	if var > pow(4, i):
		ct += 1
	else:
		break
	i += 1
print(ct)


import math
s = int(input())
binary1 = s
(decimal, i, n) = (0, 0, 0)
while s != 0:
	dec = s % 10
	decimal = decimal + dec * pow(2, i)
	s = s // 10
	i += 1
z = decimal
c = 0
for i in range(0, 101):
	e = math.pow(4, i)
	if e < z:
		c = c + 1
print(c)


n = int(input(), 2)
cont = 0
a = 1
while a < n:
	a *= 4
	cont += 1
print(cont)


from math import ceil
n = input()
ans = ceil(len(n) / 2)
if n.count('1') == 1 and (len(n) - 1) % 2 == 0:
	ans -= 1
if n == '0':
	print(0)
else:
	print(ans)


num = input()
length = len(num)
ans = length // 2
if num.count('1') > 1 and length % 2 != 0:
	ans += 1
print(ans)


s = input().rstrip()
k = 0
l = 0
for i in s:
	if i == '1':
		l = l + 1
	if l > 1:
		k = 1
		break
an = len(s) + k
print(an // 2)


numero = int(input(), 2)
numeroMulti = 1
contador = 0
while numeroMulti < numero:
	contador += 1
	numeroMulti = numeroMulti * 4
print(contador)


x = input()
num = 0
ans = 0
for i in x:
	num *= 2
	if int(i) == 1:
		num += 1
chis = 1
while chis < num:
	ans += 1
	chis *= 4
print(ans)


a = int(input(), 2)
j = 0
while 4 ** j < a:
	j += 1
print(j)


s = input()
l = len(s)
if l <= 1:
	print(0)
	quit(0)
flag = s == ''.join(['1'] + ['0'] * (l - 1))
if l % 2 == 0:
	print(l // 2)
else:
	print((l - 1) // 2 + 1 if not flag else (l - 1) // 2)


s = list(input())
tot = 0
for i in range(len(s)):
	tot += pow(2, len(s) - 1 - i) * int(s[i])
count = 0
res = 4
while pow(res, count) < tot:
	count += 1
print(count)


import math
bin = input()
ans = math.ceil(len(bin) / 2)
if not '1' in bin[1:] and len(bin) % 2 != 0:
	ans -= 1
print(ans)


import math

def binaryToDecimal(n):
	num = n
	dec_value = 0
	base1 = 1
	len1 = len(num)
	for i in range(len1 - 1, -1, -1):
		if num[i] == '1':
			dec_value += base1
		base1 = base1 * 2
	return dec_value
n = input()
ans = binaryToDecimal(n)
c = 0
while True:
	if pow(4, c) >= ans:
		break
	c += 1
print(c)


s = input()
result = (len(s) + 1) // 2 - 1
if len(s) % 2 == 1:
	for i in range(1, len(s)):
		if s[i] == '1':
			result += 1
			break
else:
	result += 1
print(result)


n = input()
r = (len(n) - 1) // 2
s = '1' + '00' * r
if s < n:
	print(r + 1)
else:
	print(r)


binary = input()
check = int(binary, 2)
k = 0
for i in range(0, check):
	if 4 ** i < check:
		k += 1
	else:
		break
print(k)


n = input()
lenpo = len(n)
lenpo -= 1
nuevoNU = 0
for i in range(0, len(n)):
	a = 0
	if n[i] == '1':
		a = 1
	nuevoNU = nuevoNU + a * pow(2, lenpo)
	lenpo -= 1
p = 1
cnt = 0
while p < nuevoNU:
	p = p << 2
	cnt += 1
print(cnt)


s = list(input())
t = ['0' for _ in range(len(s))]
t[-1] = '1'
ans = 0
i = len(s) - 1
while i >= 0 and t < s:
	t[i] = '0'
	i -= 2
	t[i] = '1'
	ans += 1
print(ans)


s = list(input())
s = s[::-1]
num = 0
k = 1
for i in range(len(s)):
	if s[i] == '1':
		num = num + k
	k *= 2
k = 1
ans = 0
while k < num:
	ans += 1
	k *= 4
print(ans)


q = input()
w = int(q, 2)
i = 1
d = 0
while i < w:
	i = i * 4
	d = d + 1
print(d)


from math import sqrt
a = input()
a = int(a, 2)
counter = 0
c = 0
co = 0
counter = int(sqrt(a))
i = 0
counter = counter ** 2
while c < int(counter):
	c = 4 ** i
	i += 1
	if c < int(a):
		co += 1
print(co)


s = input()
val = int(s, 2)
i = 1
cnt = 0
while i < val:
	i = i * 4
	cnt = cnt + 1
print(cnt)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import ceil, floor
from copy import *
from collections import deque, defaultdict
from collections import Counter as counter
from itertools import combinations
from itertools import permutations as permutate
from bisect import bisect_left as bl
from operator import *
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192
from sys import stderr

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def pow(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def gcd(a, b):
	if a == b:
		return a
	while b > 0:
		(a, b) = (b, a % b)
	return a

def prefix_sum(ar):
	return list(accumulate(ar))

def suffix_sum(ar):
	return list(accumulate(ar[::-1]))[::-1]

def N():
	return int(inp())
dx = [0, 0, 1, -1]
dy = [1, -1, 0, 0]
from collections import defaultdict

def numberOfSetBits(i):
	i = i - (i >> 1 & 1431655765)
	i = (i & 858993459) + (i >> 2 & 858993459)
	return ((i + (i >> 4) & 252645135) * 16843009 & 4294967295) >> 24
from decimal import *
from math import *

def solve():
	s = inp()
	if s == '0' or s == '1':
		print(0)
		return
	n = len(s)
	if s == '1' + '0' * (n - 1):
		print(n // 2)
	else:
		print((n + 1) // 2)
solve()


m = input()
num = int(m, 2)
x = 1
ans = 0
while x < num:
	x = x * 4
	ans = ans + 1
print(ans)


n = input()
count = 0
a = 1
while int(n) != 0 and a <= len(n):
	count += 1
	a += 2
if int(n) == pow(10, a - 3):
	print(count - 1)
else:
	print(count)


def io():
	s = input()
	num = int(s, 2)
	return num

def solve():
	num = io()
	ans = 0
	i = 1
	trains = 0
	if num < 3:
		print(0)
	else:
		while trains < num:
			trains = 4 ** i
			ans += 1
			i += 1
		print(ans)
solve()


s = input()
print((len(s) - 1) // 2 + (not all((c == '0' for c in s[1:])) or (len(s) - 1) % 2 != 0))


str = input()
S = 0
i = 0
a = len(str)
while i < a:
	if str[i] == '1':
		b = a - i - 1
		S = S + 2 ** b
	i = i + 1
x = 0
while 4 ** x < S:
	x = x + 1
print(x)


sb = list(input())
if len(sb) == 1:
	print('0')
	exit()
sd = 0
c = 0
sb.reverse()
for i in range(len(sb)):
	sd += int(sb[i]) * pow(2, i)
for i in range(1, sd + 1):
	c += 1
	if pow(4, i) >= sd:
		break
print(c)


def gen(c):
	S = '1'
	for i in range(0, c):
		S += '00'
	return S
S = int(input())
i = 0
cnt = 0
while True:
	x = int(gen(i))
	if x < S:
		cnt += 1
	else:
		break
	i += 1
print(cnt)


n = input()
m = 0
for i in n:
	m = m * 2 + int(i)
ans = 0
while 4 ** ans < m:
	ans += 1
print(ans)


from sys import stdin
import math
n = stdin.readline().strip()
if n.count('1') == 1:
	print(math.ceil((len(n) - 1) / 2))
elif n == '0':
	print(0)
else:
	print(math.ceil(len(n) / 2))


s = input().split()
n = int(s[0], 2)
cnt = 0
x = 1
while x < n:
	x = x * 4
	cnt = cnt + 1
print(cnt)


def main():
	s = input()
	k = len(s) - 1
	ans = 0
	if k % 2 == 0:
		if k == 0:
			ans = 0
		else:
			ans = k // 2
			if s > '1' + '0' * k:
				ans += 1
		print(ans)
	else:
		k -= 1
		if k == 0:
			ans = 1
		else:
			ans = k // 2 + 1
		print(ans)
	return
main()


dp = [0] * 101
dp[0] = 0
t = 0
for i in range(1, 101):
	if i % 2 == 1:
		t += 1
	dp[i] = t
s = input()
if len(s) % 2 == 0:
	print(dp[len(s)])
else:
	f = 0
	for i in range(1, len(s)):
		if s[i] == '1':
			f = 1
			break
	if f == 0:
		print(dp[len(s) - 1])
	else:
		print(dp[len(s)])


s = input()
if s == '0':
	print('0')
else:
	x = (len(s) + 1) // 2
	if s == '1' + '0' * (2 * x - 2):
		x -= 1
	print(x)


a = input()
i = len(a) - 1
x = 0
j = 0
while i >= 0:
	x += int(a[i]) * 2 ** j
	j += 1
	i -= 1
count = 0
k = 0
i = 1
while i < x:
	count += 1
	i = i * 4
print(count)


ip = str(input())
i = 0
ip = '0b' + ip
ip = eval(ip)
while 4 ** i < ip:
	i = i + 1
print(i)


from sys import stdin
inp = stdin.readline
n = int(input(), 2)
count = 0
while True:
	if 4 ** count >= n:
		break
	count += 1
print(count)


from collections import defaultdict as DD
from bisect import bisect_left as BL
from bisect import bisect_right as BR
from itertools import combinations as IC
from itertools import permutations as IP
from random import randint as RI
import sys
MOD = pow(10, 9) + 7

def IN(f=0):
	if f == 0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())
s = input()
d = int(s, 2)
p = 0
while pow(4, p) < d:
	p += 1
print(p)


n = input().strip()
if n.count('1') > 1 or len(n) % 2 == 0:
	print(int((len(n) + 1) / 2))
else:
	print(int((len(n) - 1) / 2))


a = input()
n = int(a, 2)
s = 1
c = 0
while True:
	if s >= n:
		break
	s = s * 4
	c += 1
print(c)


s = input()
l = s.__len__()
arr = list(s)
if l % 2 == 1:
	f = 0
	for i in range(1, l):
		if arr[i] == '1':
			f = 1
	temp = l // 2 + 1
	if f == 1:
		print(temp)
	else:
		print(temp - 1)
else:
	print(l // 2)


s = input()
if len(s) == 1:
	print(0)
	exit(0)
n = int(s, 2)
n -= 1
s = bin(n)[2:]
print((len(s) + 1) // 2)


import math

def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal
a = int(input())
b = binaryToDecimal(a)
s = int(0)
c = 0
while 4 ** s < b:
	c = c + 1
	s = s + 1
print(c)


n = input()
v = int(n, 2)
i = 0
c = 0
while 1:
	p = 4 ** i
	if p < v:
		c = c + 1
	else:
		break
	i = i + 1
print(c)


s = input()
n = 0
j = 1
for i in range(len(s) - 1, -1, -1):
	n += j * int(s[i])
	j = j * 2
ans = 0
i = 1
while i < n:
	ans += 1
	i = i * 4
print(ans)


from math import ceil
s = input()
if s == '0':
	print(0)
	exit(0)
n = len(s)
if s[0] == '1' and s[1:] == '0' * (n - 1):
	print(ceil((n - 1) / 2))
else:
	print(ceil(n / 2))


s = input()
if s == '1':
	print(0)
elif s[1:] == '0' * len(s[1:]) and len(s) % 2 == 1:
	print((len(s) + 1) // 2 - 1)
else:
	print((len(s) + 1) // 2)


n = input()
n = int(n, 2)
c = 0
for i in range(101):
	if 4 ** i < n:
		c += 1
print(c)


import math
s = input()
d = int(s, 2)
k = 0
while math.pow(4, k) < d:
	k += 1
print(k)


s = input()
L = list(s)
dec = 0
for i in range(len(s)):
	dec += 2 ** i * int(L[len(L) - i - 1])
cnt = 0
for k in range(1, dec + 1):
	if k == 0:
		cnt += 1
	elif 4 ** k / 4 == 4 ** (k - 1):
		cnt += 1
		if dec == 1:
			cnt -= 1
		if 4 ** k >= dec:
			break
print(cnt)


b = input()
n = int(b, 2)
x = 0
i = 0
while pow(4, i) < n:
	x += 1
	i += 1
print(x)


a = str(input())
if len(a) == 0:
	print(0)
else:
	cnt = 0
	flag = 0
	for i in range(len(a)):
		if a[i] == '1':
			cnt += 1
			if cnt > 1:
				flag = 1
				break
	z = len(a)
	if flag != 1:
		res = (z - 1) / 2
	else:
		res = z / 2
	if res > int(res):
		res = int(res) + 1
	print(int(res))


def main():
	s = int(input(), 2)
	exp = 0
	n = 1
	while n < s:
		n *= 4
		exp += 1
	print(exp)
main()


def binaryToDecimal(n):
	return int(n, 2)
s = input()
d = binaryToDecimal(s)
c = 0
for i in range(d):
	if 4 ** i < d:
		c += 1
	else:
		break
print(c)


x = input()
d = 0
a = 0
for i in range(len(x) - 1, -1, -1):
	j = int(x[i])
	h = 2 ** a
	d += j * h
	a += 1
a = 0
p = 1
while d > p:
	a += 1
	p = 4 ** a
print(a)


def binaryToDecimal(n):
	return int(n, 2)
a = str(input())
b = binaryToDecimal(a)
ax = 1
a = 1
while ax < b:
	ax = pow(4, a)
	a = a + 1
a = a - 1
print(a)


s = input()
s = s[::-1]
ans = 0
for i in range(0, len(s)):
	if s[i] == '1':
		ans += pow(2, i)
cnt = 0
ans -= 1
while ans > 0:
	ans = ans // 4
	cnt += 1
print(cnt)


n = input()
n = int(n, 2)
l = []
l.append(1)
x = 4
l.append(x)
while x <= 2 ** 100:
	x = x * 4
	l.append(x)
count = 0
i = 0
while 1:
	if l[i] < n:
		count = count + 1
		i = i + 1
	else:
		break
print(count)


a = -1
sum = 0
cont = 0
x = [int(c) for c in input()]
for i in range(len(x)):
	sum = 2 ** i * x[a] + sum
	a -= 1
s = 0
while 1:
	d = 4 ** s
	if sum <= d:
		break
	s += 1
print(s)


s = list(input())
if len(s) % 2 == 0:
	print(len(s) // 2)
elif s.count('1') > 1:
	print(len(s) // 2 + 1)
else:
	print(len(s) // 2)


s = int(input(), 2)
n = 0
counter = 0
while n < s:
	n = 4 ** counter
	counter += 1
if s != 0:
	print(counter - 1)
else:
	print(0)


s = input()
n = len(s)
if not '1' in s[1:] and n % 2 == 1:
	print((n - 1) // 2)
else:
	print((n + 1) // 2)


string = input()
n = len(string)
if n % 2 == 0:
	print(n // 2)
else:
	one = string.count('1')
	if one > 1:
		print(n // 2 + 1)
	else:
		print(n // 2)


k = int(input(), 2)
ans = 0
for x in range(0, 60):
	if 4 ** x < k:
		ans += 1
print(ans)


s = input()
s1 = 0
for i in range(len(s)):
	s1 += int(s[i]) * 2 ** (len(s) - i - 1)
i = 0
while 4 ** i < s1:
	i += 1
print(i)


a = input()
print([(len(a) - 1) // 2 + 1, len(a) // 2][a.count('1') == 1 and len(a) % 2 or a == '0'])


import math
from collections import Counter
s = input()
leng = len(s)
c = Counter(s)
d = c.most_common(len(c))
one_count = True
if s[0] != '0':
	for i in d:
		if i[0] == '1' and i[1] == 1:
			one_count = True
		else:
			one_count = False
	if one_count:
		print(math.ceil((leng - 1) / 2))
	else:
		print(math.ceil(leng / 2))
else:
	print(0)


n = int(input())
n = int(str(n), 2)
ans = 1
cnt = 0
for i in range(1, n):
	if ans >= n:
		break
	else:
		ans = 4 ** i
		cnt += 1
print(cnt)


import math

def do():
	s = input()
	if s == '0':
		return 0
	l = len(s)
	f = sum([int(c) for c in s]) == 1
	return (l - 1 >> 1) + (l - 1 & 1) if f else (l >> 1) + (l & 1)
print(do())


import math
s = input()
a = int(s, 2)
c = 0
tmp = 1
while tmp < a:
	c += 1
	tmp *= 4
print(c)


I = input
pr = print
s = I()
pr((len(s) + (s.count('1') > 1)) // 2)


a = int(input(), 2)
b = a
r = 0
while a > 0:
	r += 1
	a //= 4
if 4 ** (r - 1) == b:
	print(r - 1)
else:
	print(r)


import sys
f = sys.stdin
b = f.readline()
n = int(b, 2)
i = 0
count = 0
while 1:
	if pow(4, i) < n:
		count += 1
		i += 1
	else:
		break
print(count)


s = input()
s = s[::-1]
l = len(s)
ans = 0
for i in range(l):
	if s[i] != '0':
		ans = ans + 2 ** i
final = 0
b = 0
while True:
	cu = 4 ** b
	if cu < ans:
		final += 1
	b += 1
	if cu >= ans:
		break
print(final)


x = input()
n = 0
for i in range(len(x)):
	n += 2 ** (len(x) - i - 1) * int(x[i])
j = 0
c = 0
a = 0
if n == 0:
	print(0)
else:
	while n > a:
		a = 4 ** j
		c += 1
		j += 1
	print(c - 1)


s = int(input())
l = []
v = str(s)
for i in range(len(v)):
	l.append(int(v[-(i + 1)]))
c = 0
for i in range(len(l)):
	if l[i] == 1:
		c += 2 ** i
i = 0
e = 0
while 1:
	d = 4 ** i
	if d >= c:
		break
	else:
		e += 1
		i += 1
print(e)


from sys import stdin
a = int(stdin.readline(), 2)
b = 1
count = 0
while b < a:
	b *= 4
	count += 1
print(count)


s = input()
x = len(s)
if x % 2 == 1 or x % 2 == -1:
	x = x - 1
	x = x / 2
	if s.count('1') > 1:
		x = x + 1
else:
	x = x / 2
print(int(x))


x = int(input(), 2)
l = []
k = 0
while 1:
	if 4 ** k < x:
		l.append(4 ** k)
		k += 1
	else:
		break
print(len(l))


s = int(input())
ans = 0
t = 1
while t < s:
	ans += 1
	t *= 100
print(ans)


st = str(input())
st = '0b' + st
n = eval(st)
cu = 1
ret = 0
while cu < n:
	cu *= 4
	ret += 1
print(ret)


s = input()
s = int(s, 2)
cnt = 0
while s > pow(4, cnt):
	cnt += 1
print(cnt)


import math
s = input()
cnt = 0
while 4 ** cnt < int(s, 2):
	cnt += 1
print(cnt)


s = input()
s = int(s, 2)
z = 0
k = 1
m = 0
while z == 0:
	if k < s:
		m = m + 1
	else:
		break
	k = k * 4
print(m)


n = int(input())
n = str(n)
l = list(n)
x = len(l) - 1
c = l.count('1')
if c == 0:
	print(0)
elif len(l) % 2 != 0 and c == 1:
	print(int(x / 2))
else:
	print(int(x / 2) + 1)


b = input()
n = 0
for i in range(len(b)):
	n = n + 2 ** i * int(b[-1 - i])
cont = 0
while True:
	if 4 ** cont >= n:
		break
	cont = cont + 1
print(cont)


s = input()
num_one = 0
for letter in s:
	if letter == '1':
		num_one += 1
if s == '0':
	print(0)
elif len(s) % 2 == 0:
	print(len(s) // 2)
elif num_one > 1:
	print(len(s) // 2 + 1)
else:
	print(len(s) // 2)


bi = input()
dec = int(bi, 2)
k = 0
i = pow(4, k)
ctr = 0
while i < dec:
	ctr += 1
	k += 1
	i = pow(4, k)
print(ctr)


s = input()
k = int(s, 2)
for i in range(101):
	if pow(4, i) == k:
		print(i)
		exit()
	elif pow(4, i) > k:
		print(i)
		exit()


from math import ceil
t = input()
r = len(t) - 1
if t == '0':
	print(0)
elif t[0] == '1' and t.count('1') == 1:
	print(ceil(r / 2))
else:
	print(r // 2 + 1)


s = input()
i = 1
ans = 0
cnt = 1
while i <= len(s):
	ans += int(s[len(s) - i]) * cnt
	cnt *= 2
	i += 1
i = 1
cnt = 1
while i < ans:
	cnt += 1
	i *= 4
print(cnt - 1)


import math
s = input()
k = 0
p = 0
for i in range(len(s) - 1, -1, -1):
	if s[i] == '1':
		k = k + pow(2, p)
	p += 1
k1 = 1
c1 = 0
while k1 < k:
	k1 = k1 * 4
	c1 += 1
print(c1)


s = input().strip()
train_missed = 0
time = '1'
while not (len(time) > len(s) or (len(time) == len(s) and (not s[1:].strip('0')))):
	train_missed += 1
	time += '00'
print(train_missed)


def binToQuad(bin):
	if len(bin) % 2:
		return (len(bin) - 1) // 2 + int(bin.find('1', 1) != -1)
	else:
		return len(bin) // 2
s = str(input())
print(binToQuad(s))


def binaryToDecimal(n):
	return int(n, 2)
n = input()
c = 0
d = binaryToDecimal(n)
i = 1
while d > i:
	c = c + 1
	i = i * 4
print(c)


n = input()
if len(n) == 1:
	print(0)
elif n.count('1') == 1 and len(n) % 2 != 0:
	l = len(n) - 2
	print((l + 1) // 2)
else:
	l = len(n)
	print((l + 1) // 2)


n = input('')
decc = int(n, 2)
i = 0
ct = 0
while 4 ** i < decc:
	ct += 1
	i += 1
print(ct)


n = input()
k = int(n, 2)
t = 0
l = 1
for x in range(0, 100):
	if l < k:
		t += 1
	l *= 4
print(t)


N = input()
ans = 0
num = 1
for i in range(len(N) - 1, -1, -1):
	if int(N[i]):
		ans += num
	num *= 2
cnt = 0
num = 1
while num < ans:
	cnt += 1
	num *= 4
print(cnt)


n = int(input(), 2)
val = 1
ct = 0
for i in range(52):
	if val < n:
		ct += 1
	val *= 4
print(ct)


s = int(input())
res = 0
i = 0
k = 0
while s > 0:
	res += s % 10 * pow(2, i)
	i += 1
	s = s // 10
while res > pow(4, k):
	k += 1
print(k)


from sys import stdin, stdout
import math
arr = list(stdin.readline())
ans = 0
ones = 0
l = len(arr) - 1
for i in range(len(arr) - 1):
	ones += int(arr[i])
if arr[0] == '0':
	ans = 0
elif ones == 1:
	ans = math.ceil((l - 1) / 2)
else:
	ans = math.ceil(l / 2)
print(ans)


s = input()
base = 0
for i in s:
	if i == '1':
		base = base * 2 + 1
	else:
		base = base * 2
ans = 0
a = 1
while a < base:
	ans = ans + 1
	a = a * 4
print(ans)


n = input()
d = int(n, 2)
k = 0
count = 0
while 4 ** k < d:
	count += 1
	k += 1
print(count)


s = input()
bit = 1
n = 0
for i in range(len(s) - 1, -1, -1):
	if s[i] == '1':
		n += bit
	bit <<= 1
bit = 1
counter = 0
while n > bit:
	bit <<= 1
	counter += 1
print(counter // 2 + int(counter % 2 == 1))


s = input()
n = int(s, 2)
count = 0
while 4 ** count < n:
	count += 1
print(count)


from math import *
from itertools import *
from collections import *
from bisect import *
n = input()
if n == '0':
	print(0)
elif len(n) % 2 == 0:
	print(len(n) // 2)
elif n.count('1') == 1:
	print(len(n) // 2)
else:
	print(len(n) // 2 + 1)


import math
A = input()
Y = int(A, 2)
X = 0
while pow(4, X) < Y:
	X = X + 1
print(X)


n = int(input(), 2)
ans = 1
c = 0
while ans < n:
	ans *= 4
	c += 1
print(c)


n = input()
b = int(n, 2)
for i in range(55):
	s = pow(4, i)
	if s >= b:
		break
print(i)


b = int(input(), 2)
c = 1
count = 0
while c < b:
	count = count + 1
	c = c * 4
print(count)


num = int(input(), 2)
(n, cnt) = (1, 0)
while n < num:
	cnt += 1
	n = n * 4
print(cnt)


n = list(input())
a = 0
for i in range(len(n)):
	a += int(n[-i - 1]) * 2 ** i
c = 0
for i in range(a // 4 + 4):
	if 4 ** i < a:
		c += 1
	else:
		break
print(c)


K = int(input(), 2)
i = 0
while 4 ** i < K:
	i += 1
print(i)


s = input()
ls = len(s)
if s == 0:
	print(0)
else:
	res = (ls + 1) // 2
	b = ls % 2 == 1
	for i in range(1, ls):
		if s[i] == '1':
			b = False
			break
	if b:
		res -= 1
	print(res)


import math
import sys
from collections import defaultdict

def main():
	s = input()
	ans = 0
	dep = 0
	s1 = '1'
	while len(s1) <= len(s) and s1 < s:
		ans += 1
		dep += 1
		s1 = f"1{''.join(('0' for _ in range(2 * dep)))}"
	print(ans)
main()


s = str(input())
t = 0
len = len(s) - 1
for i in s:
	t += int(i) * 2 ** len
	len -= 1
count = 0
p = 0
while 4 ** p < t:
	p += 1
	count += 1
print(count)


def init():
	str_input = input()
	length = len(str_input)
	zero_count = str_input.count('0')
	if str_input == '0':
		print(0)
		return
	if length % 2 == 0 or zero_count == length - 1:
		print(int(length / 2))
	else:
		print(int(length / 2 + 1))
init()


n = int(input(), 2)
(multiplier, cnt) = (1, 0)
while multiplier < n:
	multiplier *= 4
	cnt += 1
print(cnt)


s = input()
(k, n) = (len(s), s.count('1'))
c = 0
if k % 2 == 0:
	k += 1
else:
	c = 1 if n > 1 else 0
print(int((k - 1) / 2 + c))


s = str(input())
number = 0
for i in range(len(s)):
	if s[i] == '1':
		number += 2 ** (len(s) - i - 1)
trains = 0
time = 1
while time < number:
	trains += 1
	time *= 4
print(trains)


n = input()[::-1]
length = len(n)
if length % 2:
	add = False
	for i in range(length - 1):
		if n[i] == '1':
			add = True
			break
	if add:
		print(length // 2 + 1)
	else:
		print(length // 2)
else:
	print(length // 2)


x = int(input())
n = str(x)
y = int(n, 2)
c = 0
k = 0
while 4 ** k < y:
	k += 1
	c += 1
print(c)


import math
a = str(bin(int(input(), 2)))[2:]
n = len(a)
flag = False
for i in range(1, n):
	if a[i] == '1':
		flag = True
if flag:
	print(int((n - 1) / 2 + 1))
elif n % 2 == 0:
	print(int((n - 1) / 2 + 1))
else:
	print(int((n - 1) / 2))


s = input()
print(len(s) // 2 + int(s[1:].count('1') != 0 and len(s) % 2 != 0))


def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
s = int(input(), 2)
ans = 0
for i in range(0, 1000):
	if 4 ** i < s:
		ans += 1
print(ans)


s = input()
n = 0
for i in range(len(s)):
	n += (s[len(s) - 1 - i] == '1') * 2 ** i
k = 0
for i in range(0, 100, 2):
	if 2 ** i < n:
		k += 1
	else:
		break
print(k)


s = input()
n = len(s) - 1
if int(s) == 0:
	print(0)
elif int(s) == 1:
	print(0)
else:
	co = n // 2 + 1
	if n % 2 == 0 and int(s) == 10 ** n:
		co -= 1
	print(co)


import math
n = input()
n = n[::-1]
x = 0
base = 1
for letra in n:
	if letra == '1':
		x += base
	base = base * 2
resp = 0
base = 1
while True:
	if x <= base:
		break
	resp += 1
	base = base * 4
print(resp)


string = input()
a = len(string)
b = string[1:]
if '1' in b:
	a += 1
print(int(a / 2))


import sys
sys.setrecursionlimit(10 ** 5 + 1)
inf = int(10 ** 20)
max_val = inf
min_val = -inf
RW = lambda : sys.stdin.readline().strip()
RI = lambda : int(RW())
RMI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
RWI = lambda : [x for x in sys.stdin.readline().strip().split()]
bin_string = input()
lens = len(bin_string)
answer = lens + ('1' in bin_string[1:])
print(answer >> 1)


s = input()
count = s.count('1')
i = len(s) - 1
ans = 0
while i >= 0:
	if len(s) == 1 and s == '0':
		break
	if s[i] == '0':
		ans += 1
	elif count > 1:
		ans += 1
	i -= 2
print(ans)


import math
a = int(input())
if a == 0:
	e = -1
else:
	b = int(math.log10(a))
	d = 10 ** b
	e = int(b / 2)
	if d == a and b % 2 == 0:
		e = e - 1
print(e + 1)


s = input()
k = len(s) - 1
if k % 2 != 0:
	print((k + 1) // 2)
else:
	k = k // 2
	if '1' in s[1:]:
		print(k + 1)
	else:
		print(k)


S = int(input(), 2)
(x, count) = (1, 0)
while x < S:
	count += 1
	x *= 4
print(count)


import sys
from collections import defaultdict
input = lambda : sys.stdin.readline().rstrip()
n = int(input(), 2)
ans = 0
i = 0
while 4 ** i < n:
	ans += 1
	i += 1
print(ans)


n = input()
c = n.count('1')
if n == '1' or n == '0':
	print('0')
else:
	l = len(n) - 1
	if not l & 1:
		if c == 1:
			print(l // 2)
		else:
			print(l // 2 + 1)
	else:
		print(l // 2 + 1)


from math import log
s = int(input(), 2)
if s <= 1:
	print(0)
else:
	a = [1]
	i = 1
	while i < s:
		i = i * 4
		a.append(i)
	print(len(a) - 1)


from math import log, floor
S = input()
index = 0
for i in range(len(S)):
	if S[i] == '1':
		index = len(S) - i - 1
		break
if index == 0:
	print(0)
	exit()
if S.count('1') == 1 and (not index & 1):
	print(int(index // 2))
else:
	print(int(index // 2) + 1)


s = input()
s2 = '00'
s1 = '1'
count = 0
while s > s1 and len(s) >= len(s1):
	count += 1
	s1 = s1 + s2
print(count)


s = input()
res = len(s) // 2
if '1' in s[1:] and len(s) % 2 == 1:
	res += 1
print(res)


import math
n = input()
p = int(n, 2)
count = 0
i = 0
while math.pow(4, i) < p:
	count += 1
	i += 1
print(count)


s = int(input())
s = int(str(s), base=2)
coun = 0
k = 1
while k < s:
	coun += 1
	k *= 4
print(coun)


n = int(input(), 2)
val = []
for i in range(50):
	val.append(4 ** i)
cnt = 0
for i in val:
	if i < n:
		cnt += 1
	else:
		break
print(cnt)


num = int(input(), 2)
(n, res) = (1, 0)
while n < num:
	res += 1
	n = n * 4
print(res)


n = input()
n = n[::-1]
s = 0
for i in range(len(n)):
	a = int(n[i])
	s = s + a * 2 ** i
f = 1
d = 1
while s > f:
	f = f * 4
	d = d + 1
print(d - 1)


s = input()
x = 0
for i in s:
	if i == '1':
		x = x * 2 + 1
	else:
		x = x * 2
ans = 0
y = 1
while y < x:
	ans += 1
	y *= 4
print(ans)


import math
binary = input()
number = int(binary, 2)
trains = 0
k = 1
while number > k:
	trains += 1
	k = k * 4
print(trains)


n = int(input(), 2)
(i, j) = (0, 0)
s = True
while s:
	if n > 4 ** i:
		j += 1
	else:
		s = False
	i += 1
print(j)


def int_multiple():
	return [int(c) for c in input().split()]

def int_single():
	return int(input())

def str_multiple():
	return [c for c in input().split()]

def str_single():
	return input()
import math
se = str_single()
s = se[::-1]
former = -2
last = -1
for i in range(len(s)):
	if s[i] == '1':
		former = last
		last = i
r = 0
if last % 2 == 0:
	r = int(last / 2)
	if former >= 0:
		r += 1
else:
	r = math.ceil(last / 2)
print(r)


s = input().strip()
if s == '0':
	print(0)
else:
	allz = True
	for i in range(1, len(s)):
		if s[i] != '0':
			allz = False
			break
	ans = (len(s) + 1) // 2
	if len(s) % 2 == 1 and allz:
		ans -= 1
	print(ans)


def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	i = 0
	j = 0
	while 1:
		k = 4 ** i
		i += 1
		if k < decimal:
			j += 1
		else:
			break
	print(j)
n = int(input())
binaryToDecimal(n)


ins = int(input(), 2)
cnt = 0
indx = 1
while indx < ins:
	cnt += 1
	indx *= 4
print(cnt)


binary = input()
decimal = int(binary, 2)
k = 0
while decimal > 4 ** k:
	k = k + 1
print(k)


from sys import stdin
from math import sqrt, gcd, log10, log, ceil, floor

def ii():
	return int(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def li():
	return list(mi())

def si():
	return stdin.readline()
a = input()
(i, n) = (1, 0)
for j in range(len(a) - 1, -1, -1):
	if int(a[j]):
		n += i
	i *= 2
(x, y) = (0, 1)
while y < n:
	x += 1
	y *= 4
print(x)


n = list(str(input()))
n0 = n.count('0')
ln = len(n)
if ln == 1:
	print(0)
elif ln == 2:
	print(1)
elif n0 == ln - 1:
	print(int(ln / 2))
elif len(n) % 2 == 1:
	print(int(ln / 2) + 1)
else:
	print(int(ln / 2))


n = input()
n = int(n, 2)
counter = 0
for i in range(1000000):
	if 4 ** i < n:
		counter += 1
	else:
		break
print(counter)