#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int l = s.length();
  long long int dp[l][10];
  memset(dp, 0, sizeof(dp[0][0]) * l * 10);
  for (int i = 0; i < 10; i++) dp[0][i] = 1;
  for (int i = 1; i < l; i++) {
    for (int j = 0; j < 10; j++) {
      int z = (s[i] - 48) + j;
      if (z % 2) {
        dp[i][z / 2] += dp[i - 1][j];
        dp[i][z / 2 + 1] += dp[i - 1][j];
      } else
        dp[i][z / 2] += dp[i - 1][j];
    }
  }
  long long int ans = 0;
  for (int i = 0; i < 10; i++) ans += dp[l - 1][i];
  int ch = 1;
  for (int i = 0; i < l - 1; i++) {
    double z = (s[i] + s[i + 1]) / 2.0;
    int x = floor(z);
    int y = ceil(z);
    if (x != s[i + 1] && y != s[i + 1]) {
      ch = 0;
      break;
    }
  }
  cout << ans - ch << endl;
}
