#include <bits/stdc++.h>
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::istream& reader = std::cin;
  int n;
  reader >> n;
  std::string s;
  reader >> s;
  if (n & 1) {
    puts("0");
    return 0;
  }
  std::vector<unsigned int> f(n + n + 10);
  int start = s.size();
  f[start] = 1;
  for (int at = 0; at < n; ++at) {
    char c = s[at];
    if (c == '?') {
      unsigned int prev = 0, next = 0;
      int bound = start + std::min({n / 2, at + 1, n - at});
      f[bound + 1] = 0;
      for (int i = start; i <= bound; ++i) {
        next = f[i];
        f[i] = (prev << 4) + (prev << 3) + prev + f[i + 1];
        prev = next;
      }
    } else {
      --start;
    }
  }
  printf("%u\n", f[start]);
}
