#include <bits/stdc++.h>
using namespace std;
char s[60];
int n;
long long f[60][60];
bool inrange(int x) { return x >= 0 && x < 10; }
bool check() {
  for (int i = 2; i <= n; i++) {
    long long t = s[i - 1] + s[i] - '0' - '0';
    if (t & 1) {
      if (t / 2 != s[i] - '0' && t / 2 + 1 != s[i] - '0') return false;
    } else if (t / 2 != s[i] - '0')
      return false;
  }
  return true;
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int j = 0; j < 10; j++) f[1][j] = 1;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < 10; j++) {
      long long c = s[i + 1] - '0', t = c + j;
      if (inrange(t / 2)) f[i + 1][t / 2] += f[i][j];
      if (t & 1 && inrange((t + 1) / 2)) f[i + 1][(t + 1) / 2] += f[i][j];
    }
  }
  long long ans = 0;
  for (int j = 0; j < 10; j++) ans += (long long)f[n][j];
  ans -= check();
  cout << ans << endl;
  return 0;
}
