#include<iostream>
using namespace std;
int main ()
{
int n,i,sdiv=0;
cin>>n;
int aux=n;
while(aux>99)
aux/=10;
for(i=1;i<=aux/2;i++)
if(aux%i==0) sdiv=sdiv+i;
if(sdiv==aux)
{
int nrc=0;
while(n!=0)
{
nrc++;
n/=10;
}
cout<<nrc;
}
else
{
int nrpare=0;
while(n!=0)
{
if(n%2==0) nrpare++;
n/=10;
}
cout<<nrpare;
}
return 0;
}