#include <bits/stdc++.h>
using namespace std;
char str[1000];
int len;
long long dp[60][11];
int main() {
  scanf("%s", str);
  len = strlen(str);
  long long ans = 0;
  int n = len;
  for (int i = 0; i <= 9; ++i) dp[0][i] = 1;
  for (int i = 1; i < n; ++i) {
    for (int j = 0; j < 10; ++j)
      if (dp[i - 1][j]) {
        int now = j + str[i] - '0';
        dp[i][now / 2] += dp[i - 1][j];
        if (now % 2) dp[i][now / 2 + 1] += dp[i - 1][j];
      }
  }
  for (int i = 0; i < 10; ++i) ans += dp[n - 1][i];
  bool flag = true;
  for (int i = 1; i < len; ++i) {
    int nn = (str[i] - '0' + str[i - 1] - '0');
    if (nn % 2) {
      if (nn / 2 != str[i] - '0' && nn / 2 + 1 != str[i] - '0') flag = false;
    } else {
      if (nn / 2 != str[i] - '0') flag = false;
    }
    if (!flag) break;
  }
  if (flag) ans--;
  cout << ans << endl;
  return 0;
}
