#include <bits/stdc++.h>
using namespace std;
int main() {
  string number;
  cin >> number;
  int n = (int)number.size();
  long long dp[51][10] = {0};
  for (int i = (0); i < ((10)); ++i) dp[0][i] = 1;
  for (int i = (0); i < ((n - 1)); ++i) {
    for (int j = (0); j < ((10)); ++j)
      if (dp[i][j]) {
        int sum = number[i + 1] - '0' + j;
        if (sum % 2 == 0) {
          sum /= 2;
          dp[i + 1][sum] += dp[i][j];
        } else {
          sum /= 2;
          dp[i + 1][sum] += dp[i][j];
          dp[i + 1][sum + 1] += dp[i][j];
        }
      }
  }
  bool mine = true;
  for (int i = (1); i < (n); ++i) {
    int d1 = number[i] - '0';
    int d2 = number[i - 1] - '0';
    mine &= ((d1 + d2) / 2 == d1 || (d1 + d2 + 1) / 2 == d1);
  }
  if (n == 1) mine = true;
  long long res = 0;
  for (int i = (0); i < ((10)); ++i) res += dp[n - 1][i];
  cout << res - mine << "\n";
  return 0;
}
