#include <bits/stdc++.h>
int a[10000002];
char n[10000002];
int main() {
  long long i, r, f, z;
  gets(n);
  for (i = 0; n[i] != '\0'; i++) a[i] = n[i] - '0';
  long long flag = 0, k, j = 0, d = 1;
  i = 0;
  r = 0;
  while (a[i] != 0) {
    flag = 0;
    k = i;
    j = 0;
    while (1) {
      if ((a[k] + a[k + 1]) == 9) {
        j++;
        k++;
      } else
        break;
    }
    if (j % 2 == 0 && j > 0) {
      f = j + 1;
      z = (f / 2) + 1;
      d = d * z;
      i = k + 1;
    } else {
      d = d;
      i = k + 1;
    }
  }
  printf("%I64d", d);
  return 0;
}
