#include <bits/stdc++.h>
using namespace std;
int main() {
  string input;
  cin >> input;
  int n = input.length();
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    a[i] = input[i] - '0';
  }
  a.push_back(1000);
  vector<int> chains;
  int chainStart = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i - 1] + a[i] != 9) {
      int length = i - chainStart;
      if (length % 2 == 1) {
        chains.push_back(length / 2 + 1);
      }
      chainStart = i;
    }
  }
  long long int ans = 1;
  for (int i = 0; i < chains.size(); i++) {
    ans *= chains[i];
  }
  cout << ans << endl;
  return 0;
}
