#include <bits/stdc++.h>
using namespace std;
int arr[100005];
int main() {
  string str;
  cin >> str;
  long long ans = 1;
  for (int i = 1; i <= str.size(); i++) {
    if (str[i] - '0' + str[i - 1] - '0' == 9)
      arr[i] = arr[i - 1] + 1;
    else if (arr[i - 1] % 2 == 0) {
      ans *= (arr[i - 1] / 2 + 1);
    }
  }
  cout << ans;
  return 0;
}
