#include <bits/stdc++.h>
using namespace std;
int sell[2001];
int win[2001];
vector<int> wins[2001];
int take[2001];
int ret[2000];
bool intersects(int a, int b, int c, int d) {
  int e = max(a, c);
  int f = min(b, d);
  return e <= f;
}
int main(void) {
  int n;
  for (int i = 0; i <= 2000; ++i) sell[i] = -1;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    static char s[16];
    int x;
    scanf("%s%d", s, &x);
    if (s[0] == 'w') {
      wins[x].push_back(i);
    } else {
      sell[x] = i;
    }
  }
  n = 1;
  ret[0] = 0;
  for (int i = 2000; i >= 0; --i) {
    win[i] = -1;
    for (vector<int>::iterator it = wins[i].begin(); it != wins[i].end(); ++it)
      if (*it < sell[i]) win[i] = *it;
    if (win[i] != -1 && sell[i] != -1) {
      take[i] = 1;
      for (int j = 2000; j > i; --j) {
        if (!take[j]) continue;
        if (intersects(win[i], sell[i], win[j], sell[j])) take[i] = 0;
      }
    }
    int k, carry = take[i];
    for (k = 0; k < n || carry; ++k) {
      ret[k] = ret[k] * 2 + carry;
      carry = ret[k] / 10;
      ret[k] %= 10;
    }
    n = k;
  }
  for (int k = n - 1; k >= 0; --k) printf("%d", ret[k]);
  printf("\n");
  return 0;
}
