#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const long long INF = 1000 * 1000 * 1000 + 7;
const long long LINF = (long long)INF * INF;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  string a;
  cin >> a;
  for (auto &x : a) x -= '0';
  long long ans = 1;
  int groupSize = 0;
  for (int i = 0; i < a.size(); i++) {
    if (i && a[i] + a[i - 1] != 9) {
      if (groupSize % 2 == 1 && groupSize != 1) ans *= groupSize / 2 + 1;
      groupSize = 0;
    }
    groupSize++;
  }
  if (groupSize % 2 == 1 && groupSize != 1) ans *= groupSize / 2 + 1;
  cout << ans;
  return 0;
}
