#include<bits/stdc++.h>
using namespace std;

using i64 = int64_t;

string remove_zero(string s){
    int cnt = 0;
    while(s[cnt] == '0')cnt++;
    s.erase(0, cnt);
    return s;
}

int main(){
    string s;
    cin >> s;
    i64 ans = 0;
    for(int i=0;i<=(int)s.size();++i){
        string a = (i == 0 ? "0" : s.substr(0,i));
        string b = (i == s.size() ? "0" : s.substr(i));
        i64 z = stoi(a), w = stoi(b);
        //cerr << a << " " << b << endl;
        if((w+z)%2 != 0 || w-z < 0 || (w-z)%2 != 0)continue;
        i64 x = (w + z) / 2, y = (w - z) / 2;
        string aa = remove_zero(to_string(x - y));
        string bb = remove_zero(to_string(x + y));
        if(bb == "")bb = "0";
        //cerr << "!!!" << s << " " << aa << " " << bb << endl;
        if(s != aa+bb)continue;
        ans++;
    }
    cout << ans << endl;

    return 0;
}
