#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <sstream>
using namespace std;

typedef pair<int, int> P;

string Plus(int x, int y){
  int a = x - y;
  int b = x + y;
  ostringstream oss1, oss2;
  oss1 << a;
  oss2 << b;
  string ret = oss1.str() + oss2.str();
  for(int i = 0 ; i < ret.size() ; i++){
    if(ret[i] != '0') break;
    else ret.erase(ret.begin()+i);
  }
  return ret;
}

int toInt(string s){
  istringstream iss(s);
  int ret;
  iss >> ret;
  return ret;
}

int main(){
  string a;
  cin >> a;
  vector<P> v;
  for(int i = 0 ; i < a.size()-1 ; i++){
    string s1 = a.substr(0, i+1);
    string s2 = a.substr(i+1);
    v.push_back(P(toInt(s1), toInt(s2)));
  }
  
  int ans = 0;
  
  for(int i = 0 ; i < v.size() ; i++){
    int t1 = (v[i].first + v[i].second) / 2;
    int t2 = v[i].second - t1;
    if(t1 < 0 || t2 < 0) continue;
    if(Plus(t1, t2) == a) ans++;
  }
  if(toInt(a) % 2 == 0) ans++;
  
  cout << ans << endl;
  return 0;
}