#include <bits/stdc++.h>
using namespace std;
int n, t, road[15][55];
long long ans;
string s;
int dpp(int a, int b) {
  if (b + 1 == t) return 1;
  if (road[a][b]) return road[a][b];
  int cnt = a + s[b + 1] - '0';
  if (cnt % 2)
    road[a][b] = dpp(cnt / 2 + 1, b + 1) + dpp(cnt / 2, b + 1);
  else
    road[a][b] = dpp(cnt / 2, b + 1);
  return road[a][b];
}
int main() {
  cin >> s;
  t = s.size();
  for (int i = 0; i < 10; i++) ans += dpp(i, 0);
  bool flag = true;
  for (int i = 0; i < t - 1; i++)
    if (abs(s[i] - s[i + 1]) > 1) flag = false;
  if (flag) ans--;
  cout << ans << endl;
  return 0;
}
