#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 10;
const long long NN = 1e18;
const int32_t M = 1e9 + 7;
const int32_t MM = 998244353;
template <typename T, typename T1>
T maxn(T &a, T1 b) {
  if (b > a) a = b;
  return a;
}
template <typename T, typename T1>
T minn(T &a, T1 b) {
  if (b < a) a = b;
  return a;
}
long long int dp[N];
void solve() {
  string second;
  cin >> second;
  long long int ans = 1;
  for (long long int(i) = 1; (i) < ((long long int)second.size()); (i)++) {
    long long int cnt = 1;
    while (second[i] - '0' + second[i - 1] - '0' == 9 &&
           i < (long long int)second.size()) {
      i++;
      cnt++;
    }
    if (cnt & 1) ans *= (cnt + 1) / 2;
  }
  cout << ans;
}
signed main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int testcase = 1;
  while (testcase--) solve();
  return 0;
}
