#include <bits/stdc++.h>
using namespace std;
long long dp[11][55];
string s;
long long memo(long long i, long long last) {
  if (i == s.size()) {
    return 1;
  }
  if (dp[last][i] != -1) {
    return dp[last][i];
  }
  long long sm = (last + (s[i] - '0'));
  if (sm % 2)
    return dp[last][i] = memo(i + 1, sm / 2) + memo(i + 1, (sm) / 2 + 1);
  else
    return dp[last][i] = memo(i + 1, sm / 2);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  memset(dp, -1, sizeof dp);
  cin >> s;
  long long ans = 0;
  for (long long i = 0; i <= 9; i++) {
    ans = ans + memo(1, i);
  }
  long long omk = true;
  for (long long i = 1; i < s.size(); i++) {
    long long x = (s[i - 1] - '0'), y = (s[i] - '0');
    x = x + y;
    if (x % 2 == 0 and y == x / 2) continue;
    if (x % 2 and (y == x / 2 or y == (x + 1) / 2)) continue;
    omk = false;
    break;
  }
  if (omk) {
    ans--;
  }
  cout << ans << endl;
  return 0;
}
