#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T checkmin(T &a, T b) {
  return (a < b) ? a : a = b;
}
namespace Poor {
const int MaxiN = 55;
string S;
long long Opt[MaxiN][10];
long long Ans;
void DP() {
  for (int i = 0; i < 10; ++i) Opt[(int)S.size() - 1][i] = 1;
  for (int i = (int)S.size() - 2; i >= 0; --i)
    for (int j = 0; j < 10; ++j) {
      int Sum = j + S[i + 1] - '0';
      if (Sum % 2 == 0)
        Opt[i][j] = Opt[i + 1][Sum / 2];
      else
        Opt[i][j] = Opt[i + 1][Sum / 2] + Opt[i + 1][(Sum + 1) / 2];
    }
}
bool Check() {
  for (int i = 1; i < (int)S.size(); ++i) {
    int Sum = S[i - 1] - '0' + S[i] - '0';
    if (Sum % 2 == 0 && S[i] - '0' == Sum / 2) continue;
    if (Sum % 2 == 1 && (S[i] - '0' == Sum / 2 || S[i] - '0' == (Sum + 1) / 2))
      continue;
    return 0;
  }
  return 1;
}
void Run() {
  cin >> S;
  DP();
  Ans = 0;
  for (int i = 0; i < 10; ++i) Ans += Opt[0][i];
  if (Check()) --Ans;
  cout << Ans << endl;
}
}  // namespace Poor
int main() {
  Poor::Run();
  return 0;
}
