#include <bits/stdc++.h>
using namespace std;
const int base = 1000000000;
void deleteLeadingZeros(vector<int>& v) {
  while (v.size() > 1 && v.back() == 0) v.pop_back();
}
void mult(vector<int> a, vector<int> b, vector<int>& c) {
  c = vector<int>(a.size() + b.size());
  for (int i = 0; i < a.size(); ++i) {
    int carry = 0;
    for (int j = 0; j < b.size() || carry; ++j) {
      long long curr =
          a[i] * 1ll * (j < b.size() ? b[j] : 0) + carry + c[i + j];
      c[i + j] = (int)(curr % base);
      carry = (int)(curr / base);
    }
  }
  deleteLeadingZeros(c);
}
void add(vector<int> a, vector<int> b, vector<int>& c) {
  int n = max(a.size(), b.size());
  c = vector<int>(n);
  int carry = 0;
  for (int i = 0; i < n || carry; ++i) {
    if (i == c.size()) c.push_back(0);
    long long curr =
        (i < a.size() ? a[i] : 0) + (i < b.size() ? b[i] : 0) + carry;
    c[i] = (int)(curr % base);
    carry = (int)(curr / base);
  }
  deleteLeadingZeros(c);
}
vector<int> binpow(vector<int>& a, int n) {
  vector<int> p(1, 1);
  while (n) {
    if (n & 1) {
      --n;
      mult(p, a, p);
    } else {
      n >>= 1;
      mult(a, a, a);
    }
  }
  deleteLeadingZeros(p);
  return p;
}
void print(vector<int>& v) {
  deleteLeadingZeros(v);
  printf("%d", v.back());
  int n = (int)v.size() - 2;
  for (int i = n; i >= 0; --i) {
    printf("%09d", v[i]);
  }
}
vector<int> maxV(vector<int>& a, vector<int>& b) {
  deleteLeadingZeros(a);
  deleteLeadingZeros(b);
  if (a.size() > b.size()) return a;
  if (b.size() > a.size()) return b;
  int n = (int)a.size() - 1;
  for (int i = n; i >= 0; --i) {
    if (a[i] != b[i]) {
      if (a[i] > b[i])
        return a;
      else
        return b;
    }
  }
  return a;
}
int main() {
  int n;
  cin >> n;
  vector<string> name(n);
  vector<int> pw(n), pos(n, -1);
  for (int i = 0; i < n; ++i) {
    cin >> name[i] >> pw[i];
    if (name[i] == "sell") {
      int cp = -1;
      for (int j = 0; j < i; ++j) {
        if (name[j] == "win" && pw[j] == pw[i]) cp = j;
      }
      pos[i] = cp;
    }
  }
  vector<vector<int> > dp(n + 1);
  dp[0] = vector<int>(1, 0);
  for (int i = 1; i < n + 1; ++i) {
    if (name[i - 1] == "win" || (name[i - 1] == "sell" && pos[i - 1] == -1)) {
      dp[i] = dp[i - 1];
    } else {
      vector<int> a(1, 2), res;
      add(binpow(a, pw[pos[i - 1]]), dp[pos[i - 1]], res);
      dp[i] = maxV(dp[i - 1], res);
    }
  }
  print(dp[n]);
  return 0;
}
