#include <bits/stdc++.h>
using namespace std;
bitset<2005> bt, dp[5100];
vector<int> G;
int n;
int pos[5100];
string s;
int main() {
  cin >> n;
  int x;
  for (int i = 1; i <= n; i++) {
    cin >> s >> x;
    if (s[0] == 'w') {
      pos[x] = i;
      dp[i] = dp[i - 1];
    } else {
      if (!pos[x])
        dp[i] = dp[i - 1];
      else {
        bt = dp[pos[x] - 1];
        bt[x] = 1;
        for (int j = 2000; j >= 0; j--) {
          if (bt[j] > dp[i - 1][j]) {
            dp[i] = bt;
            break;
          }
          if (bt[j] < dp[i - 1][j]) {
            dp[i] = dp[i - 1];
            break;
          }
        }
      }
    }
  }
  G.push_back(0);
  for (int i = 2000; i >= 0; i--) {
    int k = 0;
    for (int j = 0; j < (int)G.size(); j++) {
      int sum = k + 2 * G[j];
      G[j] = sum % 10;
      k = sum / 10;
    }
    if (k) G.push_back(k);
    if (dp[n][i]) {
      G[0]++;
      k = 0;
      for (int j = 0; j < (int)G.size(); j++) {
        int sum = G[j] + k;
        G[j] = sum % 10;
        k = sum / 10;
      }
    }
  }
  for (int i = (int)G.size() - 1; i >= 0; i--) printf("%d", G[i]);
  cout << endl;
  return 0;
}
