#include<bits/stdc++.h>
#define ll long long 
using namespace std;
int num,s[15],d;
const int c[15] = {10,9,8,7,6,5,4,3,2,1};
int main()
{
	scanf("%d",&d);
	memset(s,0,sizeof(s));
	while(d){
		s[++num]=d%10;
		d/=10;
	}
	bool fg = true;
	if(s[1]==0||s[num]==0){
		printf("0\n");
		return 0;
	}
	for(int i = 1; i <= num/2; i++){
		if(s[i]>=10){
			s[i]/=10;
			s[i+1]++;
		}
		if(s[i]>0){
			s[i]-=10;
			s[i+1]++;
		}
	}	
	for(int i = 1; i <= num/2; i++){
		int j = num-i+1;
		if(s[i]!=-s[j]){
			fg = false;
			break;
		}
	}
	if(num%2==1 && s[num/2+1]!=0)fg = false;
	if(!fg){
		printf("0\n");
		return 0;
	}
	int ans = 1;
	for(int i = 1; i <= num/2; i++){
		if(i==1)ans*=c[abs(s[i])]-1;
		else ans*=c[abs(s[i])];
	}
	if(num%2==1 &&num!=1)ans*=c[0];
	if(num%2==1 && num==1)ans*=c[0]-1;
	printf("%d\n",ans);
	return 0;
}
