#include<iostream>
#include<sstream>
using namespace std;
typedef long long ll;

ll a,A,B;

int main(){
  cin >> a;
  stringstream ss;
  ss << a;
  string s = ss.str();

  int ans = 0;
  ll k = 10;
  for(int i=0;i<s.size();i++){
    A = a/k;
    B = a%k;
    if(s[s.size()-1-i]!='0' && (A+B)%2==0 && B>=(A+B)/2){
      ans++;
    }
    k*=10;
  }

  cout << ans << endl;
}
    
    