#include <bits/stdc++.h>
using namespace std;
int main() {
  string num;
  cin >> num;
  long long dp[50][10];
  for (int i = 0; i < 50; i++)
    for (int j = 0; j < 10; j++) dp[i][j] = 0;
  for (int i = 0; i < num.size(); i++)
    for (int j = 0; j < 10; j++) {
      if (i == 0) {
        dp[i][j] = 1;
        continue;
      }
      int cur = num[i] - '0' + j;
      if (cur % 2 == 0)
        dp[i][cur / 2] += dp[i - 1][j];
      else {
        dp[i][cur / 2] += dp[i - 1][j];
        dp[i][cur / 2 + 1] += dp[i - 1][j];
      }
    }
  long long ans = 0;
  for (int i = 0; i < 10; i++) ans += dp[num.size() - 1][i];
  int f = 1;
  for (int i = 1; i < num.size(); i++) {
    if ((2 * (num[i] - '0') - (num[i] - '0' + num[i - 1] - '0') < 0
             ? -2 * (num[i] - '0') - (num[i] - '0' + num[i - 1] - '0')
             : 2 * (num[i] - '0') - (num[i] - '0' + num[i - 1] - '0')) > 1) {
      f = 0;
      break;
    }
  }
  cout << ans - f;
  return 0;
}
