#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)1e18 + 7;
const long long o5 = 716327852;
const int N = 1e5 + 2;
bitset<N> a, b;
int main() {
  string s;
  cin >> s;
  s.push_back(s.back());
  long long ans = 1;
  long long len = 0;
  char lst = '@';
  for (int i = 0; i < s.length() - 1; i++) {
    if (s[i] + s[i + 1] - '0' * 2 == 9) {
      if (lst != '@')
        len++;
      else
        lst = s[i];
    } else {
      if (s[i] == lst) ans *= (len + 3) / 2;
      lst = '@';
      len = 0;
    }
  }
  cout << ans;
  return 0;
}
