#include <iostream>
#include <cstring>

using namespace std;

string s;
int ans, k;
int a[10];

bool check (int l) {
  bool k[10];
  for (int i = 0; i < 10; i++) {
    k[i] = 0;
  }
  k[l % 10] = 1;
  k[(l / 10) % 10] = 1;
  k[(l / 100) % 10] = 1;
  k[(l / 1000) % 10] = 1;
  for (int i = 0; i <= 9; i++) {
    if (k[i] && a[i] == 1 || !k[i] && !a[i]) {
      return 0;
    }
  }
  return 1;
}

int main() {
  cin >> s;
  for (int i = 0; i < 10; i++) {
    if (s[i] == 'o') {
      k++;
    } else if (s[i] == 'x') {
      a[i] = 1;
    } else {
      a[i] = 2;
    }
  }
  for (int i = 0; i < int(1e4); i++) {
    if (check(i)) {
      ans++;
    }
  }
  cout << ans;
  return 0;
}
#include <bits/stdc++.h>
using namespace std;

int main(){
  long long n;
  cin >> n ;
  int ans1 =0;
  int ans2 =0;
  bool judge = false;
  
  for(int i=1;i<100;i++){
    for(int j=1;j<50;j++){
      if((powl(3,i)+powl(5,j))==n){
        judge = true ;
        ans1 = i;
        ans2 = j;
        break;
      }
    }
  }
  
  if(judge) cout << ans1 << ' ' << ans2 << endl;
  else cout << -1 << endl;
}
        