#include <bits/stdc++.h>
using namespace std;
int N;
vector<pair<int, int>> E;
vector<string> B(5005, "0"), P;
void m(string &s) {
  int carry = 0;
  for (int i = 0; i < s.length(); i++) {
    int n = 2 * (s[i] - '0') + carry;
    s[i] = n + '0';
    if (n > 9) {
      s[i] -= 10;
      carry = 1;
    } else
      carry = 0;
  }
  if (carry) s += '1';
}
bool operator<(const string &a, const string &b) {
  if (a.length() > b.length()) return false;
  if (a.length() == b.length()) {
    for (int i = a.length() - 1; i >= 0; i--)
      if (a[i] < b[i])
        return true;
      else if (a[i] > b[i])
        return false;
    return false;
  }
  return true;
}
string operator+(const string &a, const string &b) {
  int carry = 0;
  string x = a.length() > b.length() ? a : b;
  string y = a.length() > b.length() ? b : a;
  while (y.length() < x.length()) y += '0';
  for (int i = 0; i < x.length(); i++) {
    int n = (x[i] - '0') + (y[i] - '0') + carry;
    x[i] = n + '0';
    if (n > 9) {
      x[i] -= 10;
      carry = 1;
    } else
      carry = 0;
  }
  if (carry) x += '1';
  return x;
}
int main() {
  string s = "1";
  for (int i = 0; i <= 2000; i++) {
    P.push_back(s);
    m(s);
  }
  cin >> N;
  for (int i = 0; i < N; i++) {
    int x;
    string s;
    cin >> s >> x;
    E.push_back(make_pair(s == "sell", x));
  }
  for (int i = 1; i < N; i++) {
    B[i] = B[i - 1];
    if (E[i].first == 1)
      for (int p = i - 1; p >= 0; p--)
        if (E[p].second == E[i].second)
          B[i] = B[i] < B[p] + P[E[i].second] ? B[p] + P[E[i].second] : B[i];
  }
  string ans(B[N - 1].rbegin(), B[N - 1].rend());
  cout << ans;
}
