#include <bits/stdc++.h>
using namespace std;
struct wtf {
  static const int mod = 1e8;
  vector<int> b;
  wtf(int x = 0) : b(1, x) {}
  void operator+=(const wtf &o) {
    int len = max(b.size(), o.b.size());
    b.resize(len + 1);
    int c = 0;
    int olen = o.b.size();
    for (int i = 0; i < olen; ++i) {
      b[i] += o.b[i] + c;
      c = b[i] / mod;
      b[i] -= c * mod;
    }
    for (int i = olen; c > 0; ++i) {
      b[i] += c;
      c = b[i] / mod;
      b[i] -= c * mod;
    }
    if (b.back() == 0) b.pop_back();
  }
  void print() {
    while (b.size() > 1 && b.back() == 0) b.pop_back();
    reverse(b.begin(), b.end());
    cout << b[0];
    b.erase(b.begin());
    for (auto i : b) {
      string g = to_string(i);
      cout << string(8 - g.length(), '0') + g;
    }
    cout << "\n";
  }
};
wtf p2[2002];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  p2[0] = wtf(1);
  for (int i = 1; i <= 2000; ++i) {
    p2[i] = p2[i - 1];
    p2[i] += p2[i - 1];
  }
  int n;
  cin >> n;
  map<int, int> mp;
  string s;
  vector<int> go(n, -1);
  set<pair<int, int>> s1;
  for (int i = 0, x; i < n; ++i) {
    cin >> s >> x;
    if (s[0] == 'w')
      mp[x] = i;
    else if (mp.count(x)) {
      go[i] = mp[x];
      s1.insert({x, i});
    }
  }
  wtf ans;
  vector<bool> mark(n);
  while (!s1.empty()) {
    auto it = *s1.rbegin();
    bool ok = true;
    for (int i = go[it.second]; i <= it.second; ++i) ok &= !mark[i];
    if (ok) {
      ans += p2[it.first];
      for (int i = go[it.second]; i <= it.second; ++i) mark[i] = true;
    }
    s1.erase(it);
  }
  ans.print();
  return 0;
}
