#include <bits/stdc++.h>
using namespace std;
struct pol {
  string op;
  int x;
};
string Dodaj(string a, string b) {
  if (a.size() > b.size()) swap(a, b);
  int n = b.size() + 1;
  while (a.size() != n) a = "0" + a;
  while (b.size() != n) b = "0" + b;
  int p = 0;
  string odp(n, '0');
  for (int i = n - 1; i > 0; --i) {
    int s = (a[i] - '0') + (b[i] - '0') + p;
    odp[i] = (char)(s % 10 + '0');
    p = s / 10;
  }
  odp[0] = (char)(p + '0');
  while (odp[0] == '0') odp.erase(0, 1);
  return odp;
}
void Pot(vector<string>& poty) {
  poty[0] = "1";
  poty[1] = "2";
  for (int i = 2; i < 2001; ++i) poty[i] = Dodaj(poty[i - 1], poty[i - 1]);
}
string Max(string a, string b) {
  if (a.size() > b.size()) return a;
  if (b.size() > a.size()) return b;
  if (a > b) return a;
  return b;
}
int main() {
  ios_base::sync_with_stdio(0);
  vector<string> poty(2001);
  Pot(poty);
  int n;
  cin >> n;
  vector<pol> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i].op >> a[i].x;
  vector<string> dp(n, "0");
  vector<int> ost(2001, -1);
  if (a[0].op == "win") ost[a[0].x] = 0;
  for (int i = 1; i < n; ++i) {
    if (a[i].op == "win") {
      dp[i] = dp[i - 1];
      ost[a[i].x] = i;
    } else {
      int pos = ost[a[i].x];
      if (pos == -1)
        dp[i] = dp[i - 1];
      else {
        string d = "0";
        if (pos != 0) d = dp[pos - 1];
        dp[i] = Max(dp[i - 1], Dodaj(d, poty[a[i].x]));
      }
    }
  }
  cout << dp[n - 1];
  return 0;
}
