#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 5001;
const int MAX_M = 2001;
const int MAX_L = 300;
const int MOD = int(1e8);
struct state {
  bool v[MAX_M];
  state() { memset(v, 0, sizeof(v)); }
  bool operator>(const state &o) const {
    for (int i = MAX_M - 1; i >= 0; i--) {
      if (v[i] != o.v[i]) {
        return v[i] ? true : false;
      }
    }
    return false;
  }
};
struct Int {
  int a[MAX_L], n;
  Int() {
    memset(a, 0, sizeof(a));
    n = 0;
  }
  void operator+=(const Int &o) {
    n = max(n, o.n);
    int t = 0;
    for (int i = 0; i <= n; i++) {
      t += a[i] + o.a[i];
      a[i] = t % MOD;
      t /= MOD;
    }
    for (; t > 0; a[++n] = t % MOD, t /= MOD)
      ;
  }
  void doubleSelf() {
    int t = 0;
    for (int i = 0; i <= n; i++) {
      t += a[i] + a[i];
      a[i] = t % MOD;
      t /= MOD;
    }
    for (; t > 0; a[++n] = t % MOD, t /= MOD)
      ;
  }
  void show() {
    printf("%d", a[n]);
    for (int i = n - 1; i >= 0; i--) {
      printf("%08d", a[i]);
    }
    puts("");
  }
};
int n;
state f[MAX_N], tmp;
int last[MAX_N];
char buffer[MAX_N];
Int p, result;
int main() {
  scanf("%d", &n);
  memset(last, -1, sizeof(last));
  for (int i = 1; i <= n; i++) {
    int x;
    f[i] = f[i - 1];
    scanf("%s%d", buffer, &x);
    if (buffer[0] == 's') {
      if (last[x] != -1) {
        tmp = f[last[x]];
        tmp.v[x] = true;
        if (tmp > f[i]) {
          f[i] = tmp;
        }
      }
    } else {
      last[x] = i;
    }
  }
  p.a[0] = 1;
  for (int i = 0; i < MAX_M; i++) {
    if (f[n].v[i]) {
      result += p;
    }
    p.doubleSelf();
  }
  result.show();
}
