#include <bits/stdc++.h>
using namespace std;
const long long N = 510;
long long dp[N][15], a[N];
signed main() {
  long long n = 0;
  char x;
  while (scanf(" %c", &x) == 1) a[++n] = x - '0';
  for (long long i = 0; i <= 9; ++i) dp[1][i] = 1;
  long long flag = 1;
  for (long long i = 2; i <= n; ++i) {
    if ((a[i - 1] + a[i]) % 2 == 0 && (a[i - 1] + a[i]) / 2 != a[i])
      flag = 0;
    else if ((a[i - 1] + a[i]) / 2 + 1 != a[i] && (a[i - 1] + a[i]) / 2 != a[i])
      flag = 0;
  }
  for (long long i = 2; i <= n; ++i)
    for (long long j = 0; j <= 9; ++j) {
      if ((j + a[i]) % 2 == 0) {
        dp[i][(j + a[i]) / 2] += dp[i - 1][j];
      } else {
        dp[i][(j + a[i]) / 2] += dp[i - 1][j];
        dp[i][(j + a[i]) / 2 + 1] += dp[i - 1][j];
      }
    }
  long long ans = 0;
  for (long long i = 0; i <= 9; ++i) ans += dp[n][i];
  printf("%lld\n", ans - flag);
  return 0;
}
