#include <bits/stdc++.h>
using namespace std;
int base = 100000000, width = 8;
struct Bign {
  int len;
  long long N[1000];
  Bign() {
    len = 0;
    memset(N, 0, sizeof(N));
  }
  Bign(long long t) { *this = t; }
  Bign(char *t) { *this = t; }
  int trans(char *a, int begin, int end) {
    int sum = 0;
    for (int i = begin; i < end; i++) sum = sum * 10 + a[i] - '0';
    return sum;
  }
  int get_num(long long x) const {
    int ans = 0;
    while (x) {
      ans++;
      x /= 10;
    }
    return ans;
  }
  Bign operator=(long long x) {
    len = 0;
    memset(N, 0, sizeof(N));
    while (x) {
      N[len++] = x % base;
      x /= base;
    }
    return *this;
  }
  Bign operator=(char *a) {
    int flag = 0;
    if (a[0] == '-') {
      a = a + 1;
      flag = 1;
    }
    int L = strlen(a);
    len = (L - 1) / width + 1;
    memset(N, 0, sizeof(N));
    for (int i = 0; i < len; i++) {
      int end = L - width * i;
      int start = max(0, end - width);
      N[i] = trans(a, start, end);
    }
    if (flag) {
      N[len - 1] *= -1;
    }
    return *this;
  }
  void clear() {
    while (len > 1 && N[len - 1] == 0) len--;
    for (int i = 0; i < len - 1; i++)
      if (N[i] < 0) N[i] = -N[i];
  }
  Bign operator+(const Bign B) const {
    Bign C;
    C.len = max(len, B.len) + 10;
    for (int i = 0; i < C.len; i++)
      C.N[i] += N[i] + B.N[i], C.N[i + 1] += C.N[i] / base, C.N[i] %= base;
    C.clear();
    return C;
  }
  Bign operator-(const Bign B) const {
    Bign C;
    int flag = 0;
    if (len >= B.len) {
      C = *this;
      C.len = len;
      for (int i = 0; i < C.len; i++) {
        if (C.N[i] < B.N[i] && i < len - 1) {
          C.N[i] += base;
          C.N[i + 1]--;
        }
        C.N[i] -= B.N[i];
      }
    } else {
      C = B;
      C.len = B.len;
      flag = 1;
      for (int i = 0; i < C.len; i++) {
        if (C.N[i] < N[i]) {
          C.N[i] += base;
          C.N[i + 1]--;
        }
        C.N[i] -= N[i];
      }
    }
    C.clear();
    if (flag) C.N[C.len - 1] = -C.N[C.len - 1];
    return C;
  }
  Bign operator*(const Bign B) const {
    Bign C;
    C.len = len + B.len;
    for (int i = 0; i < len; i++)
      for (int j = 0; j < B.len; j++) C.N[i + j] += N[i] * B.N[j];
    for (int i = 0; i < C.len; i++) C.N[i + 1] += C.N[i] / base, C.N[i] %= base;
    C.clear();
    return C;
  }
  Bign operator/(long long b) const {
    Bign F = *this, C;
    for (int i = len - 1; i >= 0; i--) {
      for (int j = C.len - 1; j >= 0; j--) C.N[j + 1] = C.N[j], C.N[j] = 0;
      C.len++;
      long long t = F.N[i] / b;
      Bign T = t;
      if (i != 0) F.N[i - 1] += (F.N[i] - t * b) * base;
      C = C + T;
    }
    C.clear();
    return C;
  }
  Bign operator%(long long &b) const {
    Bign r = *this / b, C = *this - r * b;
    return C;
  }
};
void Print(Bign A) {
  printf("%lld", A.N[A.len - 1]);
  for (int i = A.len - 2; i >= 0; i--) printf("%08lld", A.N[i]);
}
struct node {
  int num, idx;
  char type;
  bool operator<(const node &k) const { return num < k.num; }
} all[5005], sell[5005], win[5005];
bool cmp(node a, node b) { return a.num > b.num; }
bool cmp1(node a, node b) { return a.num < b.num; }
Bign B = 2;
Bign quick(Bign &A, int n) {
  A = 1;
  while (n != 0) {
    if (n & 1) A = A * B;
    B = B * B;
    n >>= 1;
  }
  return A;
}
int main() {
  Bign A = 1, ans = 0LL;
  int n, id_all = 0, id_sell = 0, id_win = 0;
  scanf("%d", &n);
  char c[5];
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%s %d", c, &x);
    if (c[0] == 's')
      sell[id_sell++] = (node){x, i, c[0]};
    else
      win[id_win++] = (node){x, i, c[0]};
    all[id_all++] = (node){x, i, c[0]};
  }
  sort(sell, sell + id_sell, cmp);
  bool vis[5005] = {0};
  int now = 0;
  while (now != id_sell) {
    node t = sell[now++];
    if (!vis[t.idx]) {
      int i = t.idx, tofind = -1;
      for (; i >= 0; i--) {
        if (vis[i] == 1) break;
        if (all[i].type == 'w' && all[i].num == t.num) {
          tofind = i;
          break;
        }
      }
      if (tofind != -1) {
        for (int j = tofind; j <= t.idx; j++) vis[j] = 1;
        A = 1;
        B = 2;
        ans = ans + quick(A, t.num);
        ;
      }
    }
  }
  Print(ans);
  puts("");
  return 0;
}
