#include <bits/stdc++.h>
using namespace std;
char num[500000];
long long int res[500000];
int count_max[500000];
int main() {
  scanf("%s", num);
  long long int res = 1;
  int length = 0;
  int ptr = 1;
  while (num[ptr]) {
    length = 0;
    while (num[ptr] && num[ptr] + num[ptr - 1] - '0' - '0' == 9) {
      ptr++;
      length++;
    }
    if (length > 0 && length % 2 == 0) {
      res *= (length / 2 + 1);
    }
    ptr++;
  }
  cout << res << endl;
  return 0;
}
