#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const int N = (int)1e6 + 7, mod = 1000000007, M = 2e9;
int n, x[5007][2], t;
char s[10];
bool f[5007];
set<int> v;
vector<int> ans;
struct big {
  int a[2018], sz;
  big() {
    sz = 1;
    fill(a, a + 2018, 0);
  }
  void mul(int m, int x) {
    int c = 0, t;
    if (!a[0] && sz == 1) a[0] = 1;
    if (!x) return;
    for (int i = 0; i < sz; i++) {
      t = (a[i] * m) + c;
      a[i] = t % 10;
      c = t / 10;
    }
    if (c) a[sz++] = c;
    mul(m, x - 1);
  }
  void print() {
    for (int i = sz - 1; i >= 0; i--) printf("%d", a[i]);
    puts("");
  }
} X;
big add(int x) {
  big y;
  y.mul(2, x);
  int c = 0, t;
  X.sz = max(X.sz, y.sz);
  for (int i = 0; i < X.sz; i++) {
    t = X.a[i] + y.a[i] + c;
    X.a[i] = t % 10;
    c = t / 10;
  }
  if (c) X.a[X.sz++] = c;
  return X;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s%d", s, &t);
    if (s[0] == 's') {
      if (x[t][0]) x[t][1] = i + 1;
    } else {
      if (!x[t][1]) x[t][0] = i + 1;
    }
  }
  for (int i = 2000; i >= 0; i--) {
    if (x[i][0] && x[i][1]) {
      bool w = 0;
      for (int j = x[i][0]; j <= x[i][1]; j++) w |= f[j];
      if (!w) {
        for (int j = x[i][0]; j <= x[i][1]; j++) f[j] = 1;
        ans.push_back(i);
      }
    }
  }
  for (int i : ans) add(i);
  X.print();
  return 0;
}
