#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int dx[8] = {1, -1, 0, 0, -1, -1, 1, 1};
int dy[8] = {0, 0, -1, 1, -1, 1, -1, 1};
vector<int> adj[300010], val(300010, 1), vis(300010, 0), dis1(300010, 0),
    dis2(300010, 0);
int myrandom(int i) { return std::rand() % i; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  vector<int> v;
  for (auto i : s) {
    v.push_back(i - '0');
  }
  int n = (int)v.size();
  long long dp[n + 1][10];
  memset(dp, 0, sizeof(dp));
  for (int i = 0; i <= 9; i++) {
    dp[0][i] = 1;
  }
  for (int i = 0; i < n - 1; i++) {
    for (int j = 0; j < 10; j++) {
      long long num = s[i + 1] - '0' + j;
      if (num % 2) {
        num = num / 2;
        dp[i + 1][num] += dp[i][j];
        dp[i + 1][num + 1] += dp[i][j];
      } else {
        num = num / 2;
        dp[i + 1][num] += dp[i][j];
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i < 10; i++) {
    ans = ans + dp[n - 1][i];
  }
  bool ok = true;
  for (int i = 1; i < n; i++) {
    int num = s[i] - '0' + s[i - 1] - '0';
    if (num % 2) {
      num = num / 2;
      if (s[i] != num + '0' && s[i] != num + 1 + '0') {
        ok = false;
        break;
      }
    } else {
      num = num / 2;
      if (s[i] - '0' != num) {
        ok = false;
        break;
      }
    }
  }
  if (ok) ans--;
  cout << ans << '\n';
}
