#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double eps = 1e-8;
const double PI = acos(-1.0);
const int MAXN = 1e5 + 5;
const int MOD = 1e9 + 7;
int sgn(double x) {
  if (fabs(x) < eps) return 0;
  if (x < 0)
    return -1;
  else
    return 1;
}
long long pw(long long a, long long n, long long mod) {
  long long ret = 1;
  while (n) {
    if (n & 1) ret = ret * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return ret;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int n, a[55];
char s[55];
long long dp[55][10];
bool dfs(int i) {
  if (i > n) return true;
  int s = a[i] + a[i - 1];
  if (s / 2 == a[i] || (s + 1) / 2 == a[i]) return dfs(i + 1);
  return false;
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= n; i++) a[i] = s[i] - '0';
  for (int j = 0; j <= 9; j++) dp[1][j] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= 9; j++) {
      int s = j + a[i + 1];
      dp[i + 1][s / 2] += dp[i][j];
      if (s & 1) dp[i + 1][(s + 1) / 2] += dp[i][j];
    }
  long long ans = 0;
  int f = dfs(2);
  for (int j = 0; j <= 9; j++) ans += dp[n][j];
  printf("%I64d\n", ans - f);
}
