#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
void OJ() {}
signed main() {
  OJ();
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long c = 1;
  string s;
  cin >> s;
  long long n = s.size();
  for (long long i = 0; i < n; ++i) {
    if (s[i] - '0' + s[i + 1] - '0' == 9) {
      long long cnt = 2;
      i++;
      while (s[i] - '0' + s[i + 1] - '0' == 9 && i < n - 1) cnt++, i++;
      if (cnt % 2 == 0)
        cnt = 1;
      else
        cnt = (cnt + 1) / 2;
      c *= cnt;
    }
  }
  cout << c;
}
