#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string A;
  cin >> A;
  long long a, b, c, d;
  long long dp[A.size() + 1][10];
  for (long long i = 0; i < 10; i++) {
    dp[1][i] = 1;
  }
  for (long long i = 2; i <= A.size(); i++) {
    a = A[i - 1] - '0';
    for (long long j = 0; j < 10; j++) {
      dp[i][j] = 0;
      for (long long k = 2 * j - a - 1; k < 2 * j - a + 2; k++) {
        if (k >= 0 && k < 10) dp[i][j] += dp[i - 1][k];
      }
    }
  }
  long long flag = 0, ans = 0;
  for (long long j = 0; j < 10; j++) {
    ans += dp[A.size()][j];
  }
  for (long long i = 1; i < A.size(); i++) {
    if (abs(A[i] - A[i - 1]) > 1) {
      flag = 1;
      break;
    }
  }
  if (flag == 0) ans--;
  cout << ans << endl;
  return 0;
}
