#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
vector<int> add(vector<int> a, vector<int> b) {
  int n = a.size();
  vector<int> res(n, 0);
  int c = 0;
  for (int i = 0; i < n; i++) {
    c += a[i] + b[i];
    res[i] = c % 10;
    c /= 10;
  }
  return res;
}
vector<int> max(vector<int> a, vector<int> b) {
  for (int i = a.size() - 1; i >= 0; i--) {
    if (a[i] == b[i]) continue;
    if (a[i] > b[i])
      return a;
    else
      return b;
  }
  return a;
}
void print(vector<int> a) {
  int idx = a.size() - 1;
  while (idx >= 0 && a[idx] == 0) idx--;
  if (idx < 0) {
    cout << 0 << endl;
    return;
  }
  while (idx >= 0) cout << a[idx--];
  cout << endl;
}
string s[5010];
int x[5010];
int main() {
  int n;
  vector<int> pow[2001];
  pow[0] = vector<int>(1000, 0);
  pow[0][0] = 1;
  for (int i = 1; i <= 2000; i++) pow[i] = add(pow[i - 1], pow[i - 1]);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> s[i] >> x[i];
  vector<vector<int> > ans(n + 1, vector<int>(1000, 0));
  for (int i = 1; i <= n; i++) {
    if (i != 1) ans[i] = max(ans[i], ans[i - 1]);
    if (s[i] == "sell") continue;
    int next = -1;
    for (int j = i + 1; next == -1 && j <= n; j++) {
      if (x[j] == x[i] && s[j] == "sell") next = j;
    }
    if (next == -1) continue;
    ans[next] = max(ans[next], add(ans[i], pow[x[i]]));
  }
  print(ans[n]);
  return 0;
}
