#include <bits/stdc++.h>
using namespace std;
int n, x;
int W[2001];
pair<int, int> S[2001];
bool B[5001];
void update(int a, int b) {
  for (int i = a; i <= b; i++) B[i] = false;
}
bool ok(int a, int b) {
  for (int i = a; i <= b; i++)
    if (!B[i]) return false;
  return true;
}
vector<int> V;
struct bignum {
  char A[700];
  int l;
} m, sol;
void init(bignum *x) {
  x->l = 0;
  memset(x->A, 0, sizeof x->A);
}
void zero_justify(bignum *x) {
  while (x->A[x->l] == 0 and x->l > 0) x->l--;
}
void add(bignum a, bignum *b) {
  int carry = 0;
  b->l = max(a.l, b->l) + 1;
  for (int i = 0; i <= b->l; i++) {
    int tmp = a.A[i] + b->A[i] + carry;
    carry = tmp / 10;
    b->A[i] = tmp % 10;
  }
  zero_justify(b);
}
void multiply_2(bignum *x) {
  x->l++;
  int carry = 0;
  for (int i = 0; i <= x->l; i++) {
    int tmp = x->A[i] * 2 + carry;
    carry = tmp / 10;
    x->A[i] = tmp % 10;
  }
  zero_justify(x);
}
void print(bignum x) {
  for (int i = x.l; i >= 0; i--) printf("%c", x.A[i] + '0');
  printf("\n");
}
int main() {
  memset(W, -1, sizeof W);
  memset(S, -1, sizeof S);
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    char C[4];
    scanf("%s %d", &C, &x);
    if (C[0] == 's') {
      if (W[x] != -1) {
        S[x].first = W[x];
        S[x].second = i;
      }
    } else
      W[x] = i;
  }
  memset(B, 1, sizeof B);
  for (int i = 2000; i >= 0; i--) {
    if (S[i].first == -1) continue;
    if (ok(S[i].first, S[i].second)) {
      update(S[i].first, S[i].second);
      V.push_back(i);
    }
  }
  init(&m);
  init(&sol);
  m.A[0] = 1;
  int at = 0;
  for (vector<int>::reverse_iterator rit = V.rbegin(); rit != V.rend(); rit++) {
    int next = *rit;
    for (; at < next; at++) {
      multiply_2(&m);
    }
    add(m, &sol);
  }
  print(sol);
}
