#include <bits/stdc++.h>
using namespace std;
const int N = 5005;
int a[N], m[N];
int ans[N];
bool vis[N], have[N], choose[N];
char c[6];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s%d", c, &a[i]);
    if (c[0] == 's') {
      if (1 == have[a[i]]) m[a[i]] = i;
    }
    have[a[i]] = 1;
  }
  for (int i = 2000; i >= 0; i--) {
    if (m[i] > 0) {
      for (int j = m[i] - 1; j > 0; j--) {
        if (vis[j])
          break;
        else {
          if (a[j] == i) {
            choose[i] = 1;
            for (int t = m[i]; t >= j; t--) vis[t] = 1;
            break;
          }
        }
      }
    }
  }
  int size = 1;
  for (int i = 2000; i >= 0; i--) {
    int t = choose[i];
    for (int j = 0; j < size; j++) {
      ans[j] = ans[j] * 2 + t;
      if (ans[j] > 9) {
        ans[j] -= 10;
        t = 1;
        if (j + 1 == size) size++;
      } else
        t = 0;
    }
  }
  for (int i = size - 1; i >= 0; i--) {
    printf("%d", ans[i]);
  }
  puts("");
  return 0;
}
