#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
using namespace std;

string toString(int a) {
  char buff[128];
  sprintf(buff, "%d", a);
  return string(buff);
}

int main() {
  string a;
  cin >> a;
  int res = 0;
  for(int i = 0; i <= a.size(); ++i) {
    string ss = a.substr(0,i);
    string st = a.substr(i);
    if(ss.empty()) ss = "0";
    if(st.empty()) st = "0";
    int s = atoi(ss.c_str());
    int t = atoi(st.c_str());
    if((t-s) % 2 == 0 && (t+s)%2 == 0) {
      int x = (t+s)/2;
      int y = (t-s)/2;
      if(x >= 0 && y >= 0) {
        string ans;
        if(x-y == 0) ans = toString(x+y);
        else ans = toString(x-y)+toString(x+y);
        if(ans == a) {
          ++res;
        }
      }
    }
  }
  cout << res << endl;
  return 0;
}