#include <bits/stdc++.h>
int ans[905] = {0}, tmp[2005][905] = {0}, dg[2005] = {0}, win[2005] = {0},
    sell[2005] = {0}, x, i, down = 0, n, j, yes = 0, hold[5005] = {0}, suc = 0;
char str[6] = {'\0'};
int main() {
  scanf("%d", &n);
  tmp[0][1] = 1;
  dg[0] = 1;
  for (i = 1; i <= 2000; i++) {
    for (j = 1; j <= dg[i - 1]; j++) {
      tmp[i][j] = tmp[i - 1][j] * 2;
    }
    for (j = 1; j <= dg[i - 1]; j++) {
      if (tmp[i][j] >= 10) {
        tmp[i][j + 1] += (tmp[i][j] / 10);
        tmp[i][j] %= 10;
      }
    }
    if (tmp[i][dg[i - 1] + 1] > 0)
      dg[i] = dg[i - 1] + 1;
    else
      dg[i] = dg[i - 1];
  }
  for (i = 1; i <= n; i++) {
    scanf("%s %d", str, &x);
    if (strcmp(str, "win") == 0) {
      if (sell[x] == 0) win[x] = i;
    } else {
      sell[x] = i;
    }
  }
  down = n;
  for (i = 2000; i >= 0; i--) {
    if (sell[i] != 0 && win[i] != 0) {
      suc = 0;
      for (j = win[i]; j <= sell[i]; j++) {
        if (hold[j] == 1) break;
        if (j == sell[i] && hold[j] == 0) suc = 1;
      }
      if (suc == 1) {
        for (j = win[i]; j <= sell[i]; j++) {
          hold[j] = 1;
        }
        for (j = 1; j <= dg[i]; j++) {
          ans[j] += tmp[i][j];
        }
      }
    }
  }
  for (i = 1; i <= 900; i++) {
    ans[i + 1] += (ans[i] / 10);
    ans[i] %= 10;
  }
  i = 900;
  while (ans[i] == 0 && i >= 0) i--;
  for (; i >= 1; i--) {
    yes = 1;
    printf("%d", ans[i]);
  }
  if (yes == 0) printf("0");
  return 0;
}
