#include <bits/stdc++.h>
using namespace std;
struct bint {
  int dig[100], len;
  bint() { len = 0, dig[0] = 0; }
};
void add1(bint a, bint b, bint& c) {
  int i, carry;
  for (i = carry = 0; i <= a.len || i <= b.len || carry; i++) {
    if (i <= a.len) carry += a.dig[i];
    if (i <= b.len) carry += b.dig[i];
    c.dig[i] = carry % (int)(1e8);
    carry /= (int)(1e8);
  }
  c.len = i - 1;
}
void add2(bint a, int b, bint& c) {
  int i;
  for (i = 0; i <= a.len || b; i++) {
    if (i <= a.len) b += a.dig[i];
    c.dig[i] = b % (int)(1e8);
    b /= (int)(1e8);
  }
  c.len = i - 1;
}
void output(bint& a) {
  int i;
  i = a.len - 1;
  printf("%d", a.dig[a.len]);
  while (i >= 0) printf("%08d", a.dig[i--]);
}
bint pow2[2010];
stack<int> win[2010];
int had[2010], sell[2010];
int q[5010];
int lgl[5010];
bool legal(int l, int r) {
  if (l > r) return 0;
  for (int i = l; i <= r; i++)
    if (lgl[i]) return 0;
  return 1;
}
void colour(int l, int r) {
  for (int i = l; i <= r; i++) lgl[i] = 1;
}
int main() {
  add2(pow2[0], 1, pow2[0]);
  int i;
  for (i = 1; i <= 2000; i++) {
    add1(pow2[i - 1], pow2[i - 1], pow2[i]);
  }
  int n;
  while (scanf("%d", &n) != EOF) {
    char s[9];
    for (i = 0; i <= 2000; i++)
      while (!win[i].empty()) win[i].pop();
    for (i = 0; i <= 2000; i++) sell[i] = -1;
    for (i = 0; i <= 2000; i++) had[i] = 0;
    for (i = 1; i <= n; i++) lgl[i] = 0;
    for (i = 1; i <= n; i++) {
      scanf("%s %d", s, &q[i]);
      if (strcmp(s, "sell") == 0) q[i] = -q[i] - 1;
    }
    for (i = 1; i <= n; i++) {
      int x = q[i] >= 0 ? q[i] : -q[i] - 1;
      if (q[i] >= 0)
        win[x].push(i);
      else
        sell[x] = i;
    }
    for (i = 2000; i >= 0; i--) {
      if (sell[i] != -1) {
        while (!win[i].empty()) {
          int u = win[i].top();
          win[i].pop();
          if (legal(u, sell[i])) {
            had[i] = 1;
            colour(u, sell[i]);
            break;
          }
        }
      }
    }
    bint tp;
    for (i = 2000; i >= 0; i--)
      if (had[i]) add1(tp, pow2[i], tp);
    output(tp);
    cout << endl;
  }
  return 0;
}
