#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long i, n, c = 0, d = 1;
  string s;
  cin >> s;
  n = s.size();
  for (i = 0; i <= n - 2; i++) {
    if (((s[i] - 48) + (s[i + 1] - 48)) == 9)
      c++;
    else if (((s[i] - 48) + (s[i + 1] - 48)) != 9) {
      if ((c % 2) == 0 && c != 0) d = d + d * (c / 2);
      c = 0;
    }
  }
  if ((c % 2) == 0 && c != 0) d = d + d * (c / 2);
  if (d == 0)
    cout << 1;
  else if (d > 0)
    cout << d;
  return 0;
}
