#include <bits/stdc++.h>
using namespace std;
long long an[100], n, f[100][100];
char ch;
int main() {
  n = 1;
  while ((ch = getchar()) != '\n') {
    an[n++] = ch - '0';
  }
  memset(f, 0, sizeof(f));
  f[0][0] = 1;
  for (int num = 0; num <= 9; num++) f[1][num] = 1;
  for (int p = 1; p <= n - 2; p++) {
    for (int num = 0; num <= 9; num++) {
      int tt = an[p + 1] + num;
      if (tt % 2 == 0)
        f[p + 1][tt / 2] += f[p][num];
      else {
        f[p + 1][tt / 2 + 1] += f[p][num];
        f[p + 1][tt / 2] += f[p][num];
      }
    }
  }
  bool toSelf = 1;
  for (int p = 1; p <= n - 2; p++) {
    if (abs(an[p + 1] - an[p]) > 1) {
      toSelf = 0;
      break;
    }
  }
  long long ans = 0;
  for (int num = 0; num <= 9; num++) {
    ans += f[n - 1][num];
  }
  ans = toSelf ? ans - 1 : ans;
  printf("%I64d\n", ans);
  return 0;
}
