#include <bits/stdc++.h>
using namespace std;
string s;
long long dp[60][20];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> s;
  int n = s.size();
  for (int i = 0; i < 10; i++) dp[0][i] = 1;
  for (int i = 1; i < s.size(); i++) {
    for (int j = 0; j < 10; j++) {
      if ((j + s[i] - '0') % 2 == 0) {
        dp[i][(j + s[i] - '0') / 2] += dp[i - 1][j];
      } else {
        dp[i][(j + s[i] - '0') / 2] += dp[i - 1][j];
        dp[i][(j + s[i] - '0' + 1) / 2] += dp[i - 1][j];
      }
    }
  }
  long long res = 0;
  for (int i = 0; i < 10; i++) {
    res += dp[n - 1][i];
  }
  int ok = 1;
  for (int i = 1; i < s.size(); i++) {
    if ((s[i] - '0' + s[i - 1] - '0') / 2 != (s[i] - '0') &&
        (s[i] - '0' + s[i - 1] - '0' + 1) / 2 != (s[i] - '0')) {
      ok = 0;
      break;
    }
  }
  cout << res - ok << endl;
  return 0;
}
