#include <bits/stdc++.h>
using namespace std;
int n, m, k, d, x, y;
long long ans, t;
char s[100005];
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int main() {
  scanf("%s", s);
  n = strlen(s);
  s[n] = '9';
  t = 0;
  ans = 1;
  for (int i = 0; i < n; i++) {
    if (s[i] - '0' + s[i + 1] - '0' == 9) {
      t++;
      continue;
    }
    if (t % 2 == 0 && t > 0) ans *= t / 2 + 1;
    t = 0;
  }
  printf("%I64d\n", ans);
  return 0;
}
