#include <bits/stdc++.h>
using namespace std;
const int maxN = 1000000;
int main() {
  ios::sync_with_stdio(0);
  string s;
  cin >> s;
  long long ans = 1, n = s.size();
  for (int i = 0; i < n; i++) {
    long long now = 1;
    while (i + now < n && s[i + now - 1] + s[i + now] == '9' + '0') now++;
    i += now - 1;
    if (now % 2) ans = ans * (now + 1) / 2;
  }
  cout << ans << endl;
}
