#include <bits/stdc++.h>
using namespace std;
void prepare() {}
string s;
long long dp[55][10];
void solve() {
  memset((dp), (0), sizeof(dp));
  cin >> s;
  for (int i = 0; i < 10; i++) dp[0][i] = 1;
  for (int i = 1; i < (int)(s).size(); i++) {
    int a = s[i] - '0';
    for (int j = 0; j < 10; j++) {
      for (int k = 0; k < 10; k++) {
        if ((k + a) / 2 == j || (k + a + 1) / 2 == j) dp[i][j] += dp[i - 1][k];
      }
    }
  }
  int ok = 1;
  for (int i = 1; i < (int)(s).size(); i++) {
    int a = s[i - 1] - '0';
    int b = s[i] - '0';
    if ((a + b) / 2 != b && (a + b + 1) / 2 != b) ok = 0;
  }
  long long r = 0;
  for (int i = 0; i < 10; i++) r += dp[(int)(s).size() - 1][i];
  r -= ok;
  cout << r << endl;
}
int main() {
  prepare();
  solve();
  return 0;
}
