#include <bits/stdc++.h>
using namespace std;
long long POS(long long x) {
  if (x > 0)
    return x;
  else
    return 0;
}
struct shvm {
  long double z, y, x;
  shvm() {}
  shvm(long double z, long double y, long double x) : z(z), y(y), x(x) {}
  shvm operator+(const shvm &p) const {
    return shvm(z + p.z, y + p.y, x + p.x);
  }
  shvm operator-(const shvm &p) const {
    return shvm(z - p.z, y - p.y, x - p.x);
  }
  shvm operator*(long double con) const {
    return shvm(z * con, y * con, x * con);
  }
  shvm operator/(long double con) const {
    return shvm(z / con, y / con, x / con);
  }
  bool operator<(const shvm &rhs) const {
    return make_pair(z, make_pair(y, x)) <
           make_pair(rhs.z, make_pair(rhs.y, rhs.x));
  }
  bool operator==(const shvm &rhs) const {
    return make_pair(z, make_pair(y, x)) ==
           make_pair(rhs.z, make_pair(rhs.y, rhs.x));
  }
};
int ToInt(string s) {
  int res = 0;
  for (int i = 0; i < s.size(); i++) res = s[i] - '0' + res * 10;
  return res;
}
string ToString(int x) {
  string res;
  int a = 0;
  while (x > 0) {
    a = x % 10;
    x = x / 10;
    res.push_back(a + '0');
  }
  res = string(res.rbegin(), res.rend());
  return res;
}
int main() {
  string s;
  cin >> s;
  long long res = 1;
  long long ans = 1;
  bool ok = true;
  for (int i = 1; i < s.size(); i++) {
    res = 1;
    while ((s[i] - '0') + s[i - 1] - '0' == 9) {
      i++;
      res++;
    }
    if (res % 2) {
      res = (res + 1) / 2;
      ans = ans * res;
    }
  }
  cout << ans << endl;
  return 0;
}
