#include <bits/stdc++.h>
using namespace std;
vector<vector<long long> > earn;
vector<long long> myMax(vector<long long> v1, vector<long long> v2) {
  for (int i = 72 - 1; i >= 0; i--) {
    if (v1[i] > v2[i])
      return v1;
    else if (v1[i] < v2[i])
      return v2;
  }
  return v1;
}
vector<long long> myMul(vector<long long> v, long long a) {
  for (int j = 0; j < 72; j++) {
    v[j] *= a;
  }
  long long carry = 0;
  for (int j = 0; j < 72; j++) {
    long long tmp = (v[j] + carry) / 1000000000;
    v[j] = (v[j] + carry) % 1000000000;
    carry = tmp;
  }
  return v;
}
vector<long long> myPow(long long a, int n) {
  vector<long long> v(72, 0);
  v[0] = 1;
  if (n == 0) return v;
  if (n % 2 == 0 && a <= 1024) return myPow(a * a, n / 2);
  return myMul(myPow(a, n - 1), a);
}
vector<long long> mySum(vector<long long> v1, vector<long long> v2) {
  for (int i = 0; i < 72; i++) {
    v1[i] += v2[i];
  }
  long long carry = 0;
  for (int i = 0; i < 72; i++) {
    long long tmp = (v1[i] + carry) / 1000000000;
    v1[i] = (v1[i] + carry) % 1000000000;
    carry = tmp;
  }
  return v1;
}
string makeString(vector<long long> v) {
  string res = "";
  for (int i = 0; i < 72; i++) {
    for (int j = 0; j < 9; j++) {
      char c = '0' + (char)(v[i] % 10);
      res += " ";
      res[res.size() - 1] = c;
      v[i] /= 10;
    }
  }
  reverse(res.begin(), res.end());
  for (unsigned int i = 0; i < res.size(); i++) {
    if (res[i] != '0') return res.substr(i);
  }
  return "0";
}
int main() {
  int n;
  cin >> n;
  vector<int> stick(2005, -1);
  earn.assign(5005, vector<long long>(72, 0));
  for (int i = 1; i <= n; i++) {
    string s;
    int x;
    cin >> s >> x;
    if (s == "win") {
      stick[x] = i;
      earn[i] = earn[i - 1];
    } else if (s == "sell") {
      if (stick[x] != -1)
        earn[i] = myMax(earn[i - 1], mySum(myPow(2, x), earn[stick[x]]));
      else
        earn[i] = earn[i - 1];
    }
  }
  cout << makeString(earn[n]) << endl;
}
