#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
unsigned n, *f = new unsigned[100022], *g = new unsigned[100022];
char s[200001];
signed main() {
  scanf("%u%s", &n, s + 1);
  for (unsigned i = 0; i < 100005; i++) f[i] = g[i] = 0;
  g[1] = 1;
  for (unsigned i = 1; i <= n; i++) {
    swap(f, g);
    unsigned lim = min(i + 1, n - i + 1);
    if (s[i] == '?')
      for (unsigned j = 1; j <= lim; j++)
        g[j] = (f[j - 1] << 4) + (f[j - 1] << 3) + f[j - 1] + f[j + 1];
    else
      for (unsigned j = 1; j <= lim; j++) g[j] = f[j - 1];
  }
  printf("%u\n", g[1]);
  return 0;
}
