#include <bits/stdc++.h>
using namespace std;
const int N = 1100000;
char str[N];
int main() {
  scanf("%s", str);
  int len = strlen(str);
  int i;
  double ret = 1;
  for (i = 0; i < len; i++) {
    int total = str[i] - '0';
    int sum = 1;
    while ((i + 1) < len && (9 - total) == (str[i + 1] - '0')) {
      i++;
      sum++;
      total = str[i] - '0';
    }
    if (sum % 2 && sum > 1) ret *= (sum + 1) / 2;
  }
  printf("%.0f\n", ret);
  return 0;
}
