#include<cstdio>
#include<iostream>
using namespace std;
int n,sum;
void dfs(int k,int t){
if(t==n&&k>9){
sum++;return ;
}
int tmp=0;
for(int i=k;i<=9;i++){
tmp=tmp*10+i;
dfs(i+1,t+tmp);
if(k!=1)
dfs(i+1,t-tmp);
}
}
int main(){
scanf("%d",&n);
dfs(1,0);
printf("%d\n",sum);
return 0;
}