#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll pot10[11];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
string s;
cin >> s;
int ile = 0;
for(auto u : s){
if(u == '?'){
ile++;
}
}
cout << ile * ile * ile * ile << "\n";
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnR5cGVkZWYgbG9uZyBsb25nIGxsOwoKbGwgcG90MTBbMTFdOwoKaW50IG1haW4oKSB7Cglpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKDApOwoJY2luLnRpZSgwKTsKCWNvdXQudGllKDApOwoJc3RyaW5nIHM7CgljaW4gPj4gczsKCWludCBpbGUgPSAwOwoJZm9yKGF1dG8gdSA6IHMpewoJCWlmKHUgPT0gJz8nKXsKCQkJaWxlKys7CgkJfQoJfQoJY291dCA8PCBpbGUgKiBpbGUgKiBpbGUgKiBpbGUgPDwgIlxuIjsKCXJldHVybiAwOwp9