#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long inf = 2e18;
const int maxn = 100005;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  if (b < 0) return -1;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
const int INF = 0x3f3f3f3f;
string s;
long long dp[55][15];
int main() {
  cin >> s;
  int a[55];
  for (int i = 0; i < s.length(); i++) a[i] = s[i] - '0';
  for (int i = 0; i <= 9; i++) dp[0][i] = 1;
  for (int i = 0; i < s.length() - 1; i++) {
    for (int j = 0; j <= 9; j++) {
      if ((j + a[i + 1]) % 2 == 0) {
        dp[i + 1][(j + a[i + 1]) / 2] += dp[i][j];
      } else {
        dp[i + 1][(j + a[i + 1]) / 2] += dp[i][j];
        dp[i + 1][(j + a[i + 1]) / 2 + 1] += dp[i][j];
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i <= 9; i++) {
    ans += dp[s.length() - 1][i];
  }
  long long flg = 1;
  for (int i = 0; i < s.length() - 1; i++) {
    if (abs(a[i] - a[i + 1]) > 1) {
      flg = 0;
      break;
    }
  }
  ans -= flg;
  cout << ans << endl;
}
