#include <bits/stdc++.h>
using namespace std;
int i, i0, n, m, dp[100005];
char s[100005];
int main() {
  scanf("%s", s + 1);
  int len = strlen(s + 1);
  long long ans = 1;
  for (i = 1; i <= len; i++) {
    if (i < len && s[i] + s[i + 1] - 2 * '0' == 9) {
      for (i0 = i; i0 <= len; i0 += 2) {
        if (i0 == len || s[i0] != s[i] || s[i0 + 1] != s[i + 1]) {
          if (s[i0] == s[i])
            ans *= (i0 - i + 2) / 2, i = i0;
          else
            i = i0 - 1;
          break;
        }
      }
      if (i0 > len) break;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
