#include <bits/stdc++.h>
using namespace std;
vector<int> A, E;
set<int> B;
vector<int> refs;
void Rec(int l, int r) {
  if (l >= r) return;
  refs.assign(3001, -1);
  int mx = -1, left, right;
  for (int i = l; i <= r; ++i) {
    if (E[i] > 0) refs[A[i]] = i;
    if (E[i] < 0 && refs[A[i]] != -1) {
      if (mx == -1 || A[i] > mx) {
        mx = A[i];
        left = refs[A[i]];
        right = i;
      }
    }
  }
  if (mx == -1) return;
  Rec(l, left - 1);
  Rec(right + 1, r);
  B.insert(mx);
}
void Add(std::vector<int> &S, std::vector<int> &D) {
  int i = 0, c = 0;
  while (i < D.size() || i < S.size() || c) {
    int ad = 0;
    if (i < D.size()) ad = D[i];
    if (i < S.size())
      S[i] = S[i] + ad + c;
    else {
      S.push_back((ad + c) % 10);
      c = (ad + c) / 10;
      ++i;
      continue;
    }
    c = S[i] / 10;
    S[i] = S[i] % 10;
    ++i;
  }
}
void Mult(std::vector<int> &D, int t) {
  int i = 0, c = 0;
  while (i < D.size() || c) {
    if (i < D.size())
      D[i] = D[i] * t + c;
    else {
      D.push_back(c % 10);
      c /= 10;
      ++i;
      continue;
    }
    c = D[i] / 10;
    D[i] = D[i] % 10;
    ++i;
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string s;
    int x;
    cin >> s >> x;
    if (s == "win") {
      A.push_back(x);
      E.push_back(1);
    }
    if (s == "sell") {
      A.push_back(x);
      E.push_back(-1);
    }
  }
  Rec(0, n - 1);
  std::vector<int> D(1, 1);
  std::vector<int> S(1, 0);
  for (int i = 0; i <= 3000; ++i) {
    if (B.find(i) != B.end()) Add(S, D);
    Mult(D, 2);
  }
  for (int i = S.size() - 1; i >= 0; --i) cout << S[i];
  return 0;
}
