#include <bits/stdc++.h>
using namespace std;
int use[2010], a[5010], b[5010];
int now[2010], sum[2010], pos[2010];
void add(int *a, int *b) {
  int jw = 0, tlen1, tlen2;
  for (int i = 0; i <= 2000; i++) {
    int now = a[i] + b[i] + jw;
    b[i] = now % 10;
    jw = now / 10;
  }
}
void mul(int *a) {
  int jw = 0;
  for (int i = 0; i <= 2000; i++) {
    int now = a[i] * 2 + jw;
    a[i] = now % 10;
    jw = now / 10;
  }
}
int main() {
  memset(pos, -1, sizeof(pos));
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    char ts[10];
    scanf("%s%d", ts, &a[i]);
    if (ts[0] == 'w')
      b[i] = 0;
    else {
      b[i] = 1;
      pos[a[i]] = i;
    }
  }
  for (int i = 2000; i >= 0; i--) {
    if (pos[i] == -1) continue;
    if (b[pos[i]] == -1) continue;
    int ans = -1;
    for (int j = pos[i] - 1; j >= 0; j--) {
      if (b[j] == -1) break;
      if (a[j] == i) {
        ans = j;
        break;
      }
    }
    if (ans != -1) {
      use[i] = 1;
      for (int j = ans; j <= pos[i]; j++) b[j] = -1;
    }
  }
  now[0] = 1;
  for (int i = 0; i <= 2000; i++) {
    if (use[i]) add(now, sum);
    mul(now);
  }
  int pos = 2000;
  while (pos >= 0 && sum[pos] == 0) pos--;
  if (pos == -1)
    puts("0");
  else {
    for (int i = pos; i >= 0; i--) printf("%d", sum[i]);
    puts("");
  }
}
