#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long q, w, e, r, t = 1;
  char a[100002];
  cin >> a;
  q = strlen(a);
  w = 0;
  while (w < q) {
    r = 0;
    while ((w < q) && (a[w] + a[w + 1] - 96 == 9)) {
      w++;
      r++;
    }
    if ((r) && (r % 2 == 0)) t *= (r / 2) + 1;
    w++;
  }
  cout << t;
  return 0;
}
