#include <bits/stdc++.h>
using namespace std;
const long long thaonguyen = 1e5 + 5, inf = 1e18, thaonguyenscuteness = inf;
string s;
vector<long long> a;
long long dp[15][100];
signed main() {
  cin >> s;
  for (long long i = 0; i < s.length(); i++) {
    a.push_back(s[i] - '0');
  }
  for (long long i = 0; i <= 9; i++) {
    dp[i][0] = 1;
  }
  for (long long i = 1; i < a.size(); i++) {
    for (long long j = 0; j <= 9; j++) {
      dp[j][i] = 0;
    }
    for (long long j = 0; j <= 9; j++) {
      long long temp = a[i] + j;
      if (temp % 2 == 0) {
        dp[temp / 2][i] += dp[j][i - 1];
      } else {
        dp[temp / 2][i] += dp[j][i - 1];
        dp[temp / 2 + 1][i] += dp[j][i - 1];
      }
    }
  }
  long long ans = 0;
  for (long long i = 0; i <= 9; i++) {
    ans += dp[i][a.size() - 1];
  }
  long long ThaoNguyen = 1;
  for (long long i = 1; i < a.size(); i++) {
    if (abs(a[i] - a[i - 1]) > 1) {
      ThaoNguyen = 0;
      break;
    }
  }
  cout << ans - ThaoNguyen;
}
