从后向前能分就分
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
using namespace std;
string str,pre,temp;
bool MAX(string a,string b)
{
int n1=a.size();
bool flag=false;
int n2=b.size();
flag=false;
if(n1>n2) return true;
else if(n1==n2)
{
int w1=0;
int w2=0;
for(int i=0;w1+i<n1&&w2+i<n2;i++)
{
if(a[w1+i]==b[w2+i]) continue;
else if(a[w1+i]>b[w2+i]) return true;
else return false;
}
return true;
}
else return false;
}
int main()
{
cin>>str;
int n=str.size(),ans=1;
for(int i=n-1;i>=0;i--)
{
if(i<1) continue;
pre=str.substr(0,i);
temp=str[i]+temp;
if(str[i]=='0') continue;
if(MAX(pre,temp))
{
ans++;
temp.clear();
}
}
cout<<ans<<endl;
return 0;
}