#include <bits/stdc++.h>
const int MAX_N = 102;
using namespace std;
string s;
int dp[52][11];
long long numberOfways(int i, int digit) {
  if (i == s.length()) return 1;
  if (dp[i][digit] != -1) return dp[i][digit];
  dp[i][digit] = 0;
  int curDigit = s[i] - '0';
  int newDigit = curDigit + digit;
  if (newDigit % 2) {
    return dp[i][digit] += numberOfways(i + 1, newDigit / 2) +
                           numberOfways(i + 1, newDigit / 2 + 1);
  } else {
    return dp[i][digit] += numberOfways(i + 1, newDigit / 2);
  }
}
int main() {
  {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  };
  memset(dp, -1, sizeof(dp));
  cin >> s;
  long long ans = 0;
  for (int i = 0; i <= 9; i++) {
    ans += numberOfways(1, i);
  }
  bool ownNumber = true;
  for (int i = 0; i < s.length() - 1; i++) {
    int digit = abs(s[i] - s[i + 1]);
    if (digit > 1) {
      ownNumber = false;
      break;
    }
  }
  if (ownNumber) ans--;
  cout << ans;
  return 0;
}
