#include <iostream>
#include <cassert>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <fstream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <iomanip>
#define nextLine() { for (int c = getchar(); c != '\n' && c != EOF; c = getchar()); }
#define sqr(a) ((a)*(a))
#define has(mask,i) (((mask) & (1<<(i))) == 0 ? false : true)
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#define task "number"
using namespace std;

#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define fi first
#define se second

typedef long long LL;
typedef long double ldb;
typedef unsigned long long ULL;

const int inf = (1 << 30) - 1;
const ldb eps = 1e-9;
const ldb pi = fabs(atan2(0.0, -1.0));
const int maxn = 200005;

char s[maxn];
void Load()
{
	gets(s);
}

void Solve()
{
	int res = 0, n = strlen(s);
	assert(1 <= n && n <= 200000);

	for (int i = 0; i < n; i++)
	{
		s[i] -= '0';
		assert(0 <= s[i] && s[i] <= 9);
	}
		
	if (s[0] == 0)
	{
		printf("0");
		return;
	}

	for (int i = 0; i < (n - 1) / 2; i++)
	{
		if (s[i + 1] != 0)
			res++;
	}

	if (n % 2 == 0)
	{
		bool ok = true;
		for (int i = 0; ok && i < n / 2; i++)
		{
			if (s[i] < s[i + n / 2]) break;
			if (s[i] > s[i + n / 2]) ok = false;
		}
		if (ok) res++;
	}	
	printf("%d", res);
}

int main()
{
	freopen(task".in","r",stdin);
	freopen(task".out","w",stdout);
	Load();
	Solve();
	return 0;
}
