#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  map<char, char> mp;
  for (char a = '1', b = '8'; a <= '9'; a++, b--) mp[a] = b;
  string s;
  cin >> s;
  long long pro = 1;
  for (int i = 0; i < s.size(); i++) {
    int j = i + 1;
    char temp = s[i];
    for (; j < s.size(); j++) {
      if (mp[temp] != s[j]) {
        j--;
        break;
      }
      temp = s[j];
    }
    if (j == s.size()) j--;
    if (i == j) continue;
    if ((j - i + 1) % 2) pro *= ((j - i + 1) / 2) + 1;
    i = j;
  }
  cout << pro;
  return 0;
}
