#include <bits/stdc++.h>
using namespace std;
int main() {
  long long dp[100][20];
  string s;
  cin >> s;
  int n = s.length();
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 10; j++) {
      dp[i][j] = 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++) {
      dp[i + 1][(j + int(s[i + 1] - '0')) / 2] += dp[i][j];
      if ((j + int(s[i + 1] - '0') + 1) / 2 != (j + int(s[i + 1] - '0')) / 2)
        dp[i + 1][(j + int(s[i + 1] - '0') + 1) / 2] += dp[i][j];
    }
  }
  long long ans = 0;
  bool f = true;
  int cur = s[0] - '0';
  for (int i = 1; i < n; i++) {
    int l = (cur + (s[i] - '0')) / 2;
    int r = (cur + (s[i] - '0') + 1) / 2;
    int nx = s[i] - '0';
    if (l != nx && r != nx) {
      f = false;
      break;
    }
    cur = nx;
  }
  ans -= int(f);
  for (int j = 0; j < 10; j++) {
    ans += dp[n - 1][j];
  }
  cout << ans << endl;
  return 0;
}
