#include <bits/stdc++.h>
using namespace std;
double const eps = 1e-9;
long double const epsl = 1e-9;
int const inf = 0x3fffffff;
int const infu = 0x7fffffff;
long long const infl = 0x3fffffffffffffffLL;
unsigned long long const inful = 0x7fffffffffffffffLL;
template <class T>
inline T sqr(const T &a) {
  return a * a;
}
int const SZ = 100;
int const LBS = 8, BS = (int)pow(10., LBS);
inline void numcpy(int *b, int *a) {
  if (b != a) memmove(b, a, (a[0] + 1) * sizeof(a[0]));
}
int rs[SZ], cr[SZ];
inline void put(int *a, FILE *f = stdout) {
  int const N = 1 << 10;
  char b[N * LBS];
  fprintf(f, "%d", a[a[0]]);
  for (int i = a[0] - 1; i > 0; i -= N) {
    for (int k = 0; k < N && k < i; k++)
      for (int j = LBS - 1, x = a[i - k]; j >= 0; --j, x /= 10)
        b[k * LBS + j] = char(x % 10) + '0';
    fwrite(b, LBS, min(N, i), f);
  }
}
inline void sum(int *c, int *a, int *b) {
  if (a[0] < b[0]) swap(a, b);
  if (!b[0]) {
    if (c != a) numcpy(c, a);
    return;
  }
  c[1] = a[1] + b[1];
  for (int i = 2; i <= b[0]; i++) {
    c[i] = a[i] + b[i];
    if (c[i - 1] >= BS) c[i - 1] -= BS, c[i]++;
  }
  if (a == c)
    for (int i = b[0]; i < c[0] && c[i] >= BS; i++) c[i] -= BS, ++c[i + 1];
  else {
    for (int i = b[0] + 1; i <= a[0]; i++) {
      c[i] = a[i];
      if (c[i - 1] >= BS) c[i - 1] -= BS, c[i]++;
    }
    c[0] = a[0];
  }
  if (c[c[0]] >= BS) c[c[0]] -= BS, c[++c[0]] = 1;
}
inline void mul(int *c, int *a, int b) {
  if (!b) {
    c[0] = 0;
    return;
  }
  long long d, x = 0;
  for (int i = 1; i <= a[0]; i++) {
    d = (long long)a[i] * b + x;
    x = d / BS, c[i] = int(d - x * BS);
  }
  x ? c[c[0] = a[0] + 1] = (int)x : c[0] = a[0];
}
int const N = 2005;
int x[N], y[N], w[N];
bool isec(int x1, int y1, int x2, int y2) { return !(y1 < x2 || y2 < x1); }
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    string s;
    int p;
    cin >> s >> p;
    if (s == "win") {
      if (!y[p]) x[p] = i;
    } else
      y[p] = i;
  }
  for (int i = 2000; i >= 0; i--) {
    w[i] = 0;
    if (x[i] && y[i]) {
      bool f = 1;
      for (int j = i + 1; j <= 2000; j++)
        if (w[j] && isec(x[i], y[i], x[j], y[j])) f = 0;
      if (f) w[i] = 1;
    }
  }
  rs[0] = 0;
  cr[0] = cr[1] = 1;
  for (int i = 0; i <= 2000; i++) {
    if (w[i]) sum(rs, rs, cr);
    mul(cr, cr, 2);
  }
  put(rs);
  return 0;
}
