#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vecll = vector<ll>;
using matll = vector<vector<ll>>;

#define rep(i, n) for (ll i = 0; i < ll(n); i++)
#define repitr(id, itr) for (auto& id : itr)
#define repr(i, a, b) for (ll i = ll(a); i < ll(b); i++)
#define reprs(i, a, b, s) for (ll i = ll(a); i < ll(b); i += s)
#define reprms(i, a, b, s) for (ll i = ll(a); i > ll(b); i += s)
#define repdic(key, val, dic) for (const auto& [key, val] : dic)
#define sort_all(v) sort(v.begin(), v.end())
#define min_val(v) *min_element(v.begin(), v.end())
#define max_val(v) *max_element(v.begin(), v.end())
#define max_idx(v) distance(v.begin(), max_element(v.begin(), v.end()))
#define sum(v) accumulate(v.begin(), v.end(), 0LL)
#define all(v) v.begin(), v.end()
#define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI)
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)
#define coutdeci cout << fixed << setprecision(15)

ll smallcmb(ll n, ll r) {
    if (r < 0 || n < r) return 0;
    r = min(r, n - r);
    ll res = 1;
    rep(i, r) {
        res *= n - r + 1 + i;
        res /= i + 1;
    }
    return res;
}

string S;

int main() {
    cin >> S;
    ll o = count(all(S), 'o'), x = count(all(S), 'x');
    ll ox = count(all(S), '?');

    ll ans = 0;
    rep(i, ox + 1) {
        ll cnt = i + o;
        if (cnt == 0 || cnt > 4)
            continue;
        else if (cnt == 1)
            ans += smallcmb(ox, i);
        else if (cnt == 2)
            ans += 14 * smallcmb(ox, i);
        else if (cnt == 3)
            ans += 36 * smallcmb(ox, i);
        else if (cnt == 4)
            ans += 24 * smallcmb(ox, i);
    }
    cout << ans << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define fast_io cin.tie(0);ios_base::sync_with_stdio(0);
string to_string(string s) { return '"' + s + '"';}
string to_string(char s) { return string(1, s);}
string to_string(const char* s) { return to_string((string) s);}
string to_string(bool b) { return (b ? "true" : "false");}
template <typename A> string to_string(A);
template <typename A, typename B>string to_string(pair<A, B> p) {return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}
template <typename A> string to_string(A v) {bool f = 1; string r = "{"; for (const auto &x : v) {if (!f)r += ", "; f = 0; r += to_string(x);} return r + "}";}
void debug_out() { cout << endl; }
void show() { cout << endl; }
void pret() { cout << endl; exit(0);}
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {cout << " " << to_string(H); debug_out(T...);}
template <typename Head, typename... Tail> void show(Head H, Tail... T) {cout <<H<<" "; show(T...);}
template <typename Head, typename... Tail> void pret(Head H, Tail... T) {cout <<H<<" "; pret(T...);}
#define pr(...) cout << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
typedef long long ll;
#define int ll
typedef long double ld;
typedef vector<int> vi;
#define disp(x) cout<<x<<" ";
#define rep(i,a,b) for(int i=a;i<(int)b;i++)
#define fo(i,a,b) for(int i=a;i<=(int)b;i++)
#define rf(i,a,b) for(int i=a;i>=(int)b;i--)
#define mp make_pair
#define pb emplace_back
#define F first
#define S second
#define endl '\n'
//cout.setf(ios::fixed);cout.precision(18)
const int MOD = 1e9+7;
const int maxn = 300000+10;

int lcm(int x, int y){
	int g = __gcd(x, y);
	return (x * y) / g;
}

int32_t main(){
    fast_io;
    int n;
    cin >> n;
    int ans = 1;
    fo(i, 2, n) ans = lcm(i, ans);
    ans++;
    show(ans);
    return 0;
}