#include <bits/stdc++.h>
using namespace std;
string a[5010];
int gap[5010];
int visited[5010];
int check[5010];
int ch[5010];
int idx[5010];
int dp[2010][2010];
int dap[2010];
vector<int> vt;
vector<vector<int>> vt1;
void add(int here, int here1) {
  int ch = 0;
  for (int i = 0; i <= 2000; i++) {
    int gap = dp[here][i] + dp[here1][i] + ch;
    ch = gap / 10;
    gap %= 10;
    dap[i] = gap;
  }
}
void add1(int here) {
  int ch = 0;
  for (int i = 0; i <= 2000; i++) {
    int gap = dap[i] + dp[here][i] + ch;
    ch = gap / 10;
    gap %= 10;
    dap[i] = gap;
  }
}
int main() {
  dp[0][0] = 1;
  for (int i = 1; i <= 2000; i++) {
    memset(dap, 0, sizeof(dap));
    add(i - 1, i - 1);
    for (int y = 0; y <= 2000; y++) dp[i][y] = dap[y];
  }
  int n;
  cin >> n;
  vt1.resize(2001);
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> gap[i];
    if (a[i][0] == 's') {
      vt.push_back(gap[i]);
      idx[gap[i]] = i;
    } else {
      vt1[gap[i]].push_back(i);
    }
  }
  sort(vt.begin(), vt.end());
  for (int i = vt.size() - 1; i >= 0; i--) {
    int xx = vt[i];
    if (vt1[xx].size()) {
      int t = lower_bound(vt1[xx].begin(), vt1[xx].end(), idx[xx]) -
              vt1[xx].begin();
      t--;
      int update = 0;
      if (t >= 0) {
        for (int y = vt1[xx][t]; y <= idx[xx]; y++) {
          if (visited[y]) update = 1;
        }
        if (update) continue;
        for (int y = vt1[xx][t]; y <= idx[xx]; y++) visited[y] = 1;
        check[xx] = 1;
      }
    }
  }
  memset(dap, 0, sizeof(dap));
  for (int i = 0; i <= 2000; i++) {
    if (check[i]) {
      add1(i);
    }
  }
  int update = 0;
  for (int i = 2000; i >= 0; i--) {
    if (dap[i]) update = 1;
    if (update) printf("%d", dap[i]);
  }
  if (!update) puts("0");
}
