#include <bits/stdc++.h>
using namespace std;
bool flag[2002];
int res[2002], tmp[2002];
pair<int, int> p[5005], q[5005];
int n, c1, c2;
int t1[5005], t2[5005];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    char st[10];
    int x;
    scanf("%s%d", st, &x);
    if (st[0] == 's')
      p[c1++] = make_pair(x, i);
    else
      q[c2++] = make_pair(x, i);
  }
  sort(p, p + c1);
  sort(q, q + c2);
  for (int i = c1 - 1, j = c2 - 1; i >= 0; i--) {
    while (j >= 0 && q[j].first > p[i].first) j--;
    int pos = -1;
    while (j >= 0 && q[j].first == p[i].first) {
      if (q[j].second <= p[i].second) pos = max(pos, q[j].second);
      j--;
    }
    if (pos != -1) {
      int sum = 0;
      for (int k = p[i].second; k; k -= k & -k) sum += t1[k];
      for (int k = pos; k; k -= k & -k) sum -= t2[k];
      if (!sum) {
        flag[p[i].first] = 1;
        for (int k = pos; k <= n; k += k & -k) t1[k]++;
        for (int k = p[i].second; k <= n; k += k & -k) t2[k]++;
      }
    }
  }
  tmp[0] = tmp[1] = 1;
  res[0] = 1;
  res[1] = 0;
  for (int i = 0; i <= 2000; i++) {
    int k = 0;
    if (flag[i]) {
      for (int j = 1; j <= tmp[0]; j++) {
        res[j] += tmp[j] + k;
        if (res[j] >= 10)
          k = 1, res[j] -= 10;
        else
          k = 0;
      }
      res[0] = tmp[0];
      if (k) res[++res[0]] = k;
    }
    k = 0;
    for (int j = 1; j <= tmp[0]; j++) {
      tmp[j] = tmp[j] * 2 + k;
      k = tmp[j] / 10;
      tmp[j] %= 10;
    }
    if (k) tmp[++tmp[0]] = k;
  }
  for (int i = res[0]; i; i--) printf("%d", res[i]);
  printf("\n");
}
