#include <bits/stdc++.h>
using namespace std;
long long dp[55][11];
char s[55];
int main() {
  memset(dp, 0, sizeof(dp));
  scanf("%s", s);
  int n = strlen(s), num = s[0] - '0';
  for (int i = 0; i < 11; ++i) {
    dp[0][i] = 1;
  }
  for (int i = 1; i < n; ++i) {
    num = s[i] - '0';
    for (int j = 0; j < 10; ++j) {
      int tmp = num + j;
      if (tmp & 1) {
        dp[i][tmp / 2] += (long long)dp[i - 1][j];
        dp[i][tmp / 2 + 1] += (long long)dp[i - 1][j];
      } else {
        dp[i][tmp / 2] += (long long)dp[i - 1][j];
      }
    }
    if (dp[i - 1][10]) {
      int tmp = num + s[i - 1] - '0';
      if (tmp / 2 == num) {
        dp[i][10] = 1;
      } else if (tmp & 1 && tmp / 2 + 1 == num) {
        dp[i][10] = 1;
      }
    } else {
      dp[i][10] = 0;
    }
  }
  long long res = 0;
  for (int i = 0; i < 10; ++i) {
    res += dp[n - 1][i];
  }
  res -= dp[n - 1][10];
  printf("%I64d\n", res);
  return 0;
}
