#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <stdlib.h>
#include <time.h>
#include <algorithm>
#include <cmath>
#include <fstream>
#include <utility>
using namespace std;
long long a[100], b[100];
int main() {
long long n, i = 0, w = 0;
scanf("%lld", &n);
while (n > 0) {
i++;
b[i] = n % 10;
n /= 10;
}
a[i] = b[i] + 1;
a[i + 1] = 1;
for (long long j = i - 1; j > 0; j--) {
a[j] = a[j + 1] * (b[j] + 1);
if ((b[j] + 10 * b[j + 1] > 9) && (b[j] + 10 * b[j + 1] < 19)) {
a[j] += a[j + 2] * (18 - b[j] - 10 * b[j + 1] + 1);
}
}
printf("%lld", a[1]);
//system("pause");
}
//5, 38, 54