#include <bits/stdc++.h>
int n, m;
int b[1000000];
using namespace std;
struct ListItem {
  ListItem(ListItem* l, int d) : left(l), right(NULL), data(d) {
    if (l != NULL) l->right = this;
  }
  int data;
  ListItem *left, *right;
};
int main(int argc, char* argv[]) {
  char buf[100005];
  scanf("%s", &buf);
  n = strlen(buf);
  unsigned long long ans = 1, len = 1;
  for (int(i) = (1); (i) < (n); ++(i)) {
    if (buf[i] - 48 + buf[i - 1] - 48 == 9) {
      ++len;
    } else {
      if (len % 2L != 0) ans *= (len / 2L + 1L);
      len = 1;
    }
  }
  if (len % 2L != 0) ans *= (len / 2L + 1L);
  cout << ans << endl;
  return 0;
}
