#include <bits/stdc++.h>
using namespace std;
long long dp[100][10];
string s;
int ss[100];
int main() {
  cin >> s;
  int n = ((int)(s).size());
  for (int i = 0; i < n; i++) ss[i + 1] = s[i] - '0';
  for (int i = 0; i < 10; i++) dp[1][i] = 1;
  for (int i = 2; i <= n; i++)
    for (int j = 0; j < 10; j++) {
      long long cnt = 0;
      if (j * 2 - 1 >= ss[i] && j * 2 - 1 - ss[i] < 10) {
        int k = j * 2 - 1 - ss[i];
        cnt += dp[i - 1][k];
      }
      if (j * 2 >= ss[i] && j * 2 - ss[i] < 10) {
        int k = j * 2 - ss[i];
        cnt += dp[i - 1][k];
      }
      if (j * 2 + 1 >= ss[i] && j * 2 + 1 - ss[i] < 10) {
        int k = j * 2 + 1 - ss[i];
        cnt += dp[i - 1][k];
      }
      dp[i][j] = cnt;
    }
  long long can = 1;
  for (int i = 2; i <= n; i++) {
    if (((ss[i - 1] + ss[i]) / 2 == ss[i] ||
         (ss[i - 1] + ss[i]) / 2 - 1 == ss[i]) ||
        ((ss[i - 1] + ss[i]) / 2 + 1 == ss[i] && (ss[i - 1] + ss[i]) % 2 == 1))
      continue;
    can = 0;
    break;
  }
  long long ccnt = 0;
  for (int i = 0; i < 10; i++) ccnt += dp[n][i];
  cout << ccnt - can << endl;
  return 0;
}
