#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const int mod = (int)1e9 + 7;
const int MAX = (int)1e5 + 5;
int main(void) {
  string s;
  cin >> s;
  int len = s.length();
  int l = -1;
  long long ans = 1;
  for (int i = 0; i < (len); ++i) {
    if (i != len - 1 && (s[i] - '0' + s[i + 1] - '0') == 9) {
      continue;
    } else {
      int d = i - l;
      if (d && d % 2) ans *= ((d + 1) >> 1);
      l = i;
    }
  }
  printf("%lld", ans);
  return 0;
}
