#include<iostream>
#include<sstream>
using namespace std;
typedef long long ll;
ll s2l(string str){
  ll res;
  stringstream s;
  s<<str;
  s>>res;
  return res;
}

int check(string x,string y){
  if(x[0]=='0'&&x.size()>1||(y[0]=='0'&&y.size()>1))return 0;
  ll a = s2l(x);
  ll b = s2l(y);

  //a == c-d
  //b == c+d
  //a+b == c+c
  //a-b == -d-d
  if((a+b)%2==1)return 0;
  else if((a-b)%2==1)return 0;
  else if(a-b>0)return 0;
  else return 1;
}

int main(){
  int cnt=0;
  string str;
  cin>>str;
  for(int i=1;i<(int)str.size();i++){
    cnt+=check(str.substr(0,i),str.substr(i,str.size()-i));
  }
  cnt+=check("0",str);
  cout<<cnt<<endl;
  return 0;
}