#include <bits/stdc++.h>
using namespace std;
const int N = 100012;
char S[N];
int main() {
  long long c = 1LL;
  int w = 1;
  cin >> S;
  S[strlen(S)] = 200;
  for (int i = (1); i < (strlen(S) + 1); ++i) {
    if (S[i] - '0' + S[i - 1] - '0' == 9) {
      ++w;
    } else {
      if (w > 1) {
        if (w % 2 == 1) c *= (w / 2 + 1);
        w = 1;
      }
    }
  }
  cout << c << endl;
  return 0;
}
