#include <bits/stdc++.h>
using namespace std;
long long dp[55][10];
string s;
long long solve(int n, int last) {
  if (n == (int)s.size() - 1) return 1;
  if (dp[n][last] != -1) return dp[n][last];
  int num = ((s[n + 1] - '0') + last);
  if (num % 2 == 0)
    dp[n][last] = solve(n + 1, num / 2);
  else
    dp[n][last] = solve(n + 1, num / 2) + solve(n + 1, num / 2 + 1);
  return dp[n][last];
}
int main() {
  cin >> s;
  memset(dp, -1, sizeof(dp));
  long long res = 0;
  if (s.size() == 1) {
    cout << 9 << endl;
    return 0;
  }
  for (int i = 0; i < 10; i++) {
    int num = ((s[1] - '0') + i);
    if (num % 2 == 0) {
      res += solve(1, num / 2);
    } else
      res += solve(1, num / 2) + solve(1, num / 2 + 1);
  }
  bool check = true;
  for (int i = 1; i < (int)s.size(); i++) {
    int num = (s[i] - '0') + (s[i - 1] - '0');
    if (num % 2 == 0) {
      if (num / 2 != (s[i] - '0')) check = false;
    } else {
      if (num / 2 != (s[i] - '0') and num / 2 + 1 != (s[i] - '0'))
        check = false;
    }
  }
  cout << res - check << endl;
}
