#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector< ll > vi;
typedef pair< ll, ll > pi;

#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for(ll i = a; i <= b; i++)
#define nl "\n"

const int MAX_N = 1e5 + 1;
const ll MOD = 1e9 + 7;
const ll INF = 1e11;
const ll NINF = -1e11;
const ll epsilon = 1e-9;

ll fast_pow(ll base, ll exp, ll mod){
    if(exp == 0)
        return 1;
    if(exp == 1)
        return base%mod;
    ll half = fast_pow(base, exp/2, mod);
    if(exp % 2 == 0)
        return (half%mod * half%mod)%mod;
    else
        return ((half%mod * half%mod)%mod * base%mod)%mod;
}

ll fast_pow_iter(ll base, ll exp, ll mod){
    ll ans = 1;
    while(exp > 0){
        if(exp & 1)
            ans = (ans * base)%mod;
        base = (base * base)%mod;
        exp >>= 1;
    }
    return ans;
}

ll gcd(ll a, ll b){
    if(b == 0)
        return a;
    return gcd(b, a%b);
}

ll gcd_extended(ll a, ll b, ll& s, ll& t){
    if(b == 0){
        s = 1;
        t = 0;
        return a;
    }

    ll s1,t1;
    ll d = gcd_extended(b, a%b, s1, t1);
    s = t1;
    t = s1 - t1 * (a/b);
    return d;
}
ll sum = 0;
ll fact[10];
set< string > st;
void find_all(vector< ll > must, vector< ll > v){
    if(must.size() == 4){
        ll hash[10] = {0};
        string s;
        for(ll i=0; i<4; i++){
            s.PB('0' + must[i]);
            hash[must[i]]++;
        }
        sort(s.begin(), s.end());
        if(st.find(s) != st.end()){
            return;
        }
        st.insert(s);
        ll value = 24;
        for(ll i=0; i<10; i++){
            value /= fact[hash[i]];
        }
        sum += value;
        return;
    }

    for(ll i=0; i<v.size(); i++){
        must.PB(v[i]);
        find_all(must, v);
        must.pop_back();
    }
    return;
}

void solve() {
    // Code for problem here
    string s;
    cin >> s;
    ll o=0,unsure=0;
    vector< ll > v;
    vector< ll > must;
    for(ll i=0; i<s.length(); i++){
        if(s[i] == 'o'){
            o++;
            v.PB(i);
            must.PB(i);
        }
        else if(s[i] == '?'){
            unsure++;
            v.PB(i);
        }
    }
    if(o > 4){
        cout << 0 << endl;
        return;
    }
    
    fact[0] = 1;
    for(ll i=1; i<10; i++){
        fact[i] = i * fact[i-1];
    }
    sum = 0;
    find_all(must, v);
    cout << sum << endl;
    return;
}

int main()
{
    
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    
    int total_cases = 1;
    // cin >> total_cases;
    for (int t = 1; t <= total_cases; t++) {
        // cout << "Case #" << t  << ": ";
        solve();
    }
    return 0;
}
#pragma region Template  // clang-format off
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
// #include <atcoder/all>
// using namespace atcoder;
#define rep(i, m, n) for (int i = m; i < (int)(n); i++)
#define repe(i, m, n) for (int i = m; i <= (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define yesno {cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}
using ll = long long;
using vvi = vector<vector<int>>;
using P = pair<int,int>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#pragma endregion Template  // clang-format on

int main() {
  int n;
  cin >> n;
  map<int, ll> m;
  rep(i, 0, n) {
    int a;
    cin >> a;
    m[a]++;
  }

  ll ans = 0;
  repe(i, -200, 200) {
    repe(j, i, 200) { ans += m[i] * m[j] * (i - j) * (i - j); }
  }

  cout << ans << endl;
}
