#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr[100002];
  long long cont = 0;
  char c;
  while (cin >> c) {
    arr[cont] = c - 48;
    cont++;
  }
  long long cant = 1, tmp_cant;
  for (long i = 1; i < cont; i++) {
    tmp_cant = 0;
    if (arr[i] + arr[i - 1] == 9) {
      tmp_cant++;
      i++;
      for (; i < cont;) {
        if (arr[i] + arr[i - 1] == 9) {
          tmp_cant++;
          i++;
        } else
          break;
      }
    }
    if (tmp_cant > 1 && tmp_cant % 2 == 0) {
      cant *= (tmp_cant / 2) + 1;
    }
  }
  cout << cant << endl;
  return 0;
}
