#include <bits/stdc++.h>
using namespace std;
char s[100100];
int main() {
  scanf("%s", s);
  long long x, ans = 1;
  for (int i = 0; s[i]; ++i) {
    x = 0;
    while (s[i] && s[i] + s[i + 1] == '4' + '5') ++i, ++x;
    if (!(x & 1)) ans *= x / 2 + 1;
  }
  printf("%lld", ans);
  return 0;
}
