#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > a, b;
vector<int> ans, f, r;
bool u[10000];
inline void add(vector<int>& a, vector<int> b) {
  while (a.size() < b.size()) {
    a.push_back(0);
  }
  for (int i = 0; i < b.size(); ++i) a[i] += b[i];
  int o = 0;
  for (int i = 0; i < a.size(); ++i) {
    a[i] += o;
    o = a[i] / 10;
    a[i] %= 10;
  }
  if (o) a.push_back(o);
}
int main() {
  int n;
  cin >> n;
  int x;
  string s;
  for (int i = 0; i < n; ++i) {
    cin >> s >> x;
    if (s == "sell") {
      a.push_back(make_pair(x, i));
    } else {
      b.push_back(make_pair(i, x));
    }
  }
  sort(a.rbegin(), a.rend());
  for (int i = 0; i < a.size(); ++i) {
    for (int j = b.size() - 1; j >= 0; --j) {
      if (u[j] && b[j].first < a[i].second) break;
      if (b[j].first < a[i].second && b[j].second == a[i].first) {
        ans.push_back(a[i].first);
        int k = j;
        while (b[k].first < a[i].second) {
          u[k] = 1;
          k++;
        }
        break;
      }
    }
  }
  reverse(ans.begin(), ans.end());
  int k = 0;
  r.push_back(1);
  f.push_back(0);
  for (int i = 0; i < ans.size(); ++i) {
    while (k < ans[i]) {
      k++;
      add(r, r);
    }
    add(f, r);
  }
  for (int i = f.size() - 1; i >= 0; --i) {
    cout << f[i];
  }
  cout << endl;
  return 0;
}
