#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
const double pi = acos(-1.0);
const double eps = 1e-9;
string second;
int n;
unsigned long long ans = 1ll;
int main() {
  getline(cin, second);
  n = (int)second.size();
  int i = 0;
  while (i < n) {
    if (i + 1 >= n || (second[i + 1] + second[i] - '0' - '0' != 9)) {
      i++;
      continue;
    }
    char x = second[i], y = second[i + 1];
    int j = i;
    while (j < n) {
      int sz = j - i;
      if (sz % 2 == 0 && x != second[j]) break;
      if (sz % 2 == 1 && y != second[j]) break;
      j++;
    }
    int sz = j - i;
    if (sz % 2) ans *= (sz + 1) / 2;
    i = j;
  }
  cout << ans;
  return 0;
}
