#include <bits/stdc++.h>
using namespace std;
const double PI = cos(-1);
struct Pair {
  int x;
  int y;
} a[5050];
int have[2050];
int sell[2050];
int used[5050];
int b[1050], nb;
char s[10];
void twice() {
  for (int i = 0; i <= nb; i++) {
    b[i] <<= 1;
  }
  for (int i = 0; i < nb; i++) {
    if (b[i] > 9) {
      b[i + 1] += b[i] / 10;
      b[i] %= 10;
    }
  }
  while (b[nb] > 9) {
    b[nb + 1] = b[nb] / 10;
    b[nb] %= 10;
    nb++;
  }
}
void up() {
  b[0]++;
  for (int i = 0; i < nb; i++) {
    if (b[i] > 9) {
      b[i + 1] += b[i] / 10;
      b[i] %= 10;
    }
  }
  while (b[nb] > 9) {
    b[nb + 1] = b[nb] / 10;
    b[nb] %= 10;
    nb++;
  }
}
void print() {
  for (int i = nb; i >= 0; i--) {
    printf("%d", b[i]);
  }
  printf("\n");
}
int main() {
  int x, n, j;
  while (scanf("%d", &n) != EOF) {
    memset(b, 0, sizeof(b));
    nb = 0;
    memset(used, 0, sizeof(used));
    memset(sell, -1, sizeof(sell));
    for (int i = 0; i < n; i++) {
      scanf("%s%d", s, &x);
      if (s[0] == 's') {
        sell[x] = i;
        a[i] = (Pair){0, x};
      } else
        a[i] = (Pair){1, x};
    }
    for (int i = 2000; i >= 0; i--) {
      twice();
      if (sell[i] >= 0) {
        for (j = sell[i]; j >= 0; j--) {
          if (used[j]) break;
          if (a[j].x == 1 && a[j].y == i) break;
        }
        if (j >= 0 && !used[j]) {
          for (; j <= sell[i]; j++) {
            used[j] = 1;
          }
          up();
        }
      }
    }
    print();
  }
  return 0;
}
