#include <bits/stdc++.h>
using namespace std;
const int maxl = 2002;
const int maxn = 5123;
struct BigInteger {
  int d[maxl];
};
BigInteger f[maxn];
BigInteger st[maxl];
void Mull(BigInteger &a, int t, BigInteger &b) {
  int i;
  for (i = 0; i < maxl; i++) b.d[i] = t * a.d[i];
  int q;
  for (i = 0, q = 0; i < maxl; i++) {
    b.d[i] = b.d[i] + q;
    q = b.d[i] / 10;
    b.d[i] %= 10;
  }
}
void Add(BigInteger &a, BigInteger &b, BigInteger &c) {
  int i, q = 0;
  for (i = 0; i < maxl; i++) {
    c.d[i] = a.d[i] + b.d[i] + q;
    q = c.d[i] / 10;
    c.d[i] %= 10;
  }
}
int Cmp(BigInteger &a, BigInteger &b) {
  int i;
  for (i = maxl - 1; i >= 0; i--) {
    if (a.d[i] != b.d[i]) return a.d[i] < b.d[i];
  }
  return 0;
}
void Print(BigInteger &a) {
  int i, q = 0;
  for (i = maxl - 1; i >= 0; i--) {
    q |= a.d[i];
    if (i == 0 || q) printf("%d", a.d[i]);
  }
}
BigInteger z;
int ty[maxn], v[maxn];
int go[maxn];
int pr[maxn];
string s;
int main() {
  int i, j, k, n;
  scanf("%d\n", &n);
  for (i = 0; i < maxl; i++) memset(st[i].d, 0, sizeof st[i].d);
  for (i = 0; i < n; i++) memset(f[i].d, 0, sizeof f[i].d);
  st[0].d[0] = 1;
  memset(go, -1, sizeof go);
  memset(pr, -1, sizeof pr);
  for (i = 1; i < maxl; i++) {
    Mull(st[i - 1], 2, st[i]);
  }
  for (i = 0; i < n; i++) {
    cin >> s >> v[i];
    if (s == "win") {
      ty[i] = 1;
    } else {
      assert(s == "sell");
      ty[i] = 2;
    }
  }
  for (i = n - 1; i >= 0; i--) {
    if (ty[i] == 2) pr[v[i]] = i;
    if (ty[i] == 1) go[i] = pr[v[i]];
  }
  for (i = 0; i < n; i++) {
    if (ty[i] == 1) {
      Add(f[i], st[v[i]], z);
      if (Cmp(f[go[i]], z)) f[go[i]] = z;
    }
    if (Cmp(f[i + 1], f[i])) f[i + 1] = f[i];
  }
  Print(f[n - 1]);
  printf("\n");
  return 0;
}
