#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long x = 0;
  long long sum = 1;
  for (int i = 0; i < s.length(); i++) {
    x = 0;
    while (s[i] + s[i + 1] - '0' - '0' == 9 && i + 1 < s.length()) {
      x++;
      i++;
    }
    if (x % 2 == 0 && x >= 2) {
      sum *= (x / 2 + 1);
    }
  }
  cout << sum;
}
