#include <iostream>
using namespace std;
int pot4(int x) {
return x * x * x * x;
}
int main() {
string s;
cin >> s;
int a = 0, b = 0;
for (auto c : s) {
a += c == '?';
b += c == 'o';
}
int ans = 0;
if (b == 0) ans = pot4(a);
if (b == 1) ans = pot4(a+1) - pot4(a);
if (b == 2) ans = pot4(a+2) - 2 * pot4(a+1) + pot4(a);
if (b == 3) ans = pot4(a+3) - 3 * pot4(a+2) + 3 * pot4(a+1) - pot4(a);
if (b == 4) ans = 24;
cout << ans << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IHBvdDQoaW50IHgpIHsKCXJldHVybiB4ICogeCAqIHggKiB4Owp9CgppbnQgbWFpbigpIHsKCXN0cmluZyBzOwoJY2luID4+IHM7CglpbnQgYSA9IDAsIGIgPSAwOwoJZm9yIChhdXRvIGMgOiBzKSB7CgkJYSArPSBjID09ICc/JzsKCQliICs9IGMgPT0gJ28nOwoJfQoJaW50IGFucyA9IDA7CglpZiAoYiA9PSAwKSBhbnMgPSBwb3Q0KGEpOyAKCWlmIChiID09IDEpIGFucyA9IHBvdDQoYSsxKSAtIHBvdDQoYSk7CglpZiAoYiA9PSAyKSBhbnMgPSBwb3Q0KGErMikgLSAyICogcG90NChhKzEpICsgcG90NChhKTsKCWlmIChiID09IDMpIGFucyA9IHBvdDQoYSszKSAtIDMgKiBwb3Q0KGErMikgKyAzICogcG90NChhKzEpIC0gcG90NChhKTsKCWlmIChiID09IDQpIGFucyA9IDI0OwoJY291dCA8PCBhbnMgPDwgZW5kbDsKCXJldHVybiAwOwp9