#include <bits/stdc++.h>
using namespace ::std;
int num(char c) { return c - '0'; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string S;
  cin >> S;
  long long sol = 1;
  int cont = 0;
  for (int i = 2; i <= S.size(); i++) {
    int act = num(S[i - 1]), ant = 0;
    if (i > 1) ant = num(S[i - 2]);
    if (act + ant == 9) {
      if (cont == 0)
        cont = 2;
      else
        cont++;
    } else {
      sol *= cont % 2 ? (cont / 2) + 1 : 1;
      cont = 0;
    }
  }
  sol *= cont % 2 ? (cont / 2) + 1 : 1;
  cout << sol << '\n';
  return 0;
}
