#include <bits/stdc++.h>
using namespace std;
struct B {
  vector<unsigned> vs;
  B(unsigned u) { vs.push_back(u); }
  B() {}
  B operator+=(const B& v) {
    vector<unsigned> n;
    unsigned long long c = 0;
    for (int i = 0; i < max(vs.size(), v.vs.size()); i++) {
      unsigned long long r = c;
      if (i < vs.size()) {
        r += vs[i];
      }
      if (i < v.vs.size()) {
        r += v.vs[i];
      }
      n.push_back(r & ((1LL << 32) - 1));
      c = r >> 32;
    }
    if (c) {
      n.push_back(c);
    }
    vs.swap(n);
    return *this;
  }
  void div(unsigned d, unsigned& carry) {
    unsigned long long c = 0;
    vector<unsigned> n;
    for (int i = vs.size() - 1; i >= 0; i--) {
      unsigned long long t = (c << 32) + vs[i];
      c = t % d;
      if (n.size() || t / d) {
        n.push_back(t / d);
      }
    }
    reverse(n.begin(), n.end());
    carry = c;
    vs.swap(n);
  }
  string toStr() {
    B b = *this;
    string str;
    while (b.vs.size()) {
      unsigned c;
      b.div(10, c);
      str.push_back((char)(c + '0'));
    }
    if (str.size() == 0) {
      return "0";
    }
    reverse(str.begin(), str.end());
    return str;
  }
};
int wp[2001];
int sp[2001];
int main() {
  int n;
  scanf("%d", &n);
  memset(wp, -1, sizeof(wp));
  memset(sp, -1, sizeof(sp));
  for (int i = 0; i < n; i++) {
    char in[100];
    int v;
    scanf("%s%d", in, &v);
    if (in[0] == 'w') {
      if (sp[v] == -1) {
        wp[v] = i;
      }
    } else {
      sp[v] = i;
    }
  }
  map<int, int> used;
  B b;
  for (int i = 2000; i >= 0; i--) {
    if (0 <= wp[i] && wp[i] < sp[i]) {
      auto it = used.upper_bound(wp[i]);
      if (it != used.end()) {
        if (wp[it->second] < sp[i]) {
          continue;
        }
      }
      used[sp[i]] = i;
      int p = i / 32;
      int q = i % 32;
      if (b.vs.size() <= p) {
        b.vs.resize(p + 1);
      }
      b.vs[p] |= (1 << q);
    }
  }
  printf("%s\n", b.toStr().c_str());
  return 0;
}
