#include <bits/stdc++.h>
using namespace std;
unsigned long long f(int n) {
  if (n == 0 || n & 1) return 1;
  return n / 2 + 1;
}
int main() {
  string s;
  while (cin >> s) {
    unsigned long long ans = 1;
    int n = 0;
    for (int i = 0; i < s.length(); i++)
      if (i == n - 1 || (s[i] - '0' + s[i + 1] - '0' != 9)) {
        ans *= f(n);
        n = 0;
      } else
        n++;
    cout << ans << endl;
  }
  return 0;
}
