#include <bits/stdc++.h>

using namespace std;

string s;
int a[100], len, ans = 0;

int judge()
{
    int i, car = 0;
    for(i=0;i<(len+1)/2;i++)
    {
        a[len-i-1] = (a[i]+s[len-i-1]-'0'+car) % 10;
        car = (a[i]+s[len-i-1]-'0'+car) / 10;
    }
    for(i=(len+1)/2;i<len;i++)
    {
        if(a[len-i-1] != ((a[i]+s[len-i-1]-'0'+car) % 10))
            return 0;
        car = (a[i]+s[len-i-1]-'0'+car) / 10;
    }
    if(a[len-1] != 0) return 1;
    return 0;
}

void dfs(int idx,int num)
{
    if(idx == num)
    {
        ans += judge();
        return ;
    }

    for(int i=0;i<=9;i++)
    {
        a[idx] = i;
        dfs(idx+1,num);
    }

    return;
}

int main()
{
    cin >> s;
    len = s.size();
    memset(a,-1,sizeof(a));
    dfs(0,(len+1)/2);
    cout << ans << endl;
    return 0;
}
