#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  string s;
  cin >> s;
  long long dp[2][10] = {{1, 1, 1, 1, 1, 1, 1, 1, 1, 1}};
  int len = s.length(), LAST = 0;
  for (int i = 1; i < len; ++i) {
    memset(dp[(LAST + 1) % 2], 0, sizeof(dp[(LAST + 1) % 2]));
    for (int j = 0; j < 10; ++j) {
      dp[(LAST + 1) % 2][(j + s[i] - '0') / 2] += dp[LAST][j];
      if ((j + s[i] - '0') & 1)
        dp[(LAST + 1) % 2][(j + s[i] - '0') / 2 + 1] += dp[LAST][j];
    }
    LAST = (LAST + 1) % 2;
  }
  long long ans = 0;
  for (int i = 0; i < 10; ++i) {
    ans += dp[LAST][i];
  }
  int f = 1;
  for (int i = 1; i < len; ++i) {
    if (abs(s[i] - s[i - 1]) > 1) {
      f = 0;
      break;
    }
  }
  cout << ans - f << endl;
}
