#include <bits/stdc++.h>
int main() {
  int i, len2 = 1, len;
  char str[100001];
  scanf("%s", str);
  i = 1, len = strlen(str);
  long long k = 1;
  while (i < len) {
    while (i < len && str[i] - '0' == 9 - str[i - 1] + '0') {
      i++;
      len2++;
    }
    i++;
    if (len2 > 1) {
      if (len2 % 2 != 0) k = k * (len2 + 1) / 2;
    }
    len2 = 1;
  }
  printf("%I64d", k);
  return 0;
}
