#include <cstdio>
#include <cmath>
using namespace std;
int combinations1(int x) {
return x <= 9 ? -abs(x - 9) + 10 : 0;
}
int combinations2(int x) {
return x >= 10 && x <= 18 ? -abs(x - 9) + 10 : 0;
}
int main() {
unsigned long long n;
unsigned long long result[20] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int i = 1;
scanf("%lld", &n);
while(n) {
result[i] += combinations1(n%10) * result[i-1];
result[i+1] += combinations2(n%100) * result[i-1];
i++;
n /= 10;
}
printf("%lld\n", result[i-1]);
}