#include <bits/stdc++.h>
using namespace std;
using namespace std;
int T;
int N;
int const MaxBits = 900 * 4;
int const Bits = 4;
int const MaxLen = MaxBits / Bits + 1;
int const MaxSingle = 10000;
struct BigInt {
  int Dig[MaxLen];
  int Digs;
  void operator=(char *s);
  void operator=(long long n);
  void Print();
};
void BigInt::Print() {
  printf("%d", Dig[Digs - 1]);
  for (int i = Digs - 2, tmp; i >= 0; i--) {
    tmp = MaxSingle / 10;
    while (tmp > 1) {
      if (Dig[i] < tmp)
        printf("0");
      else
        break;
      tmp /= 10;
    }
    printf("%d", Dig[i]);
  }
}
void BigInt::operator=(long long n) {
  Digs = 0;
  while (n > 0) {
    Dig[Digs++] = n % MaxSingle;
    n /= MaxSingle;
  }
  for (int i = Digs; i < MaxLen; i++) Dig[i] = 0;
}
void BigInt::operator=(char *StrNum) {
  int len = strlen(StrNum), tmp;
  Digs = 0;
  for (; len >= Bits; len -= Bits) {
    tmp = 0;
    for (int i = len - Bits; i < len; i++) tmp *= 10, tmp += StrNum[i] - '0';
    Dig[Digs++] = tmp;
  }
  if (len == 0) return;
  tmp = 0;
  for (int i = 0; i < len; i++) tmp *= 10, tmp += StrNum[i] - '0';
  Dig[Digs++] = tmp;
  for (int i = Digs; i < MaxLen; i++) Dig[i] = 0;
}
BigInt operator+(BigInt const &a, BigInt const &b) {
  BigInt c = a;
  int carry(0);
  c.Digs = c.Digs < b.Digs ? b.Digs : c.Digs;
  for (int i = 0; i < c.Digs; i++) {
    c.Dig[i] += b.Dig[i] + carry;
    if (c.Dig[i] >= MaxSingle)
      c.Dig[i] -= MaxSingle, carry = 1;
    else
      carry = 0;
  }
  if (carry > 0) c.Dig[c.Digs++] = carry;
  return c;
}
BigInt operator-(BigInt const &a, BigInt const &b) {
  BigInt c = a;
  int dec = 0;
  for (int i = 0; i < c.Digs; i++) {
    c.Dig[i] -= b.Dig[i] + dec;
    if (c.Dig[i] < 0)
      c.Dig[i] += MaxSingle, dec = 1;
    else
      dec = 0;
  }
  while (c.Digs > 1 && c.Dig[c.Digs - 1] == 0) c.Digs--;
  return c;
}
BigInt operator*(BigInt const &a, BigInt const &b) {
  BigInt c;
  for (int i = 0; i < MaxLen; i++) c.Dig[i] = 0;
  int carry;
  for (int i = 0; i < a.Digs; i++) {
    carry = 0;
    for (int j = 0; j < b.Digs; j++) {
      c.Dig[i + j] += a.Dig[i] * b.Dig[j] + carry;
      carry = c.Dig[i + j] / MaxSingle;
      c.Dig[i + j] -= carry * MaxSingle;
    }
    if (carry != 0) c.Dig[i + b.Digs] += carry;
  }
  c.Digs = a.Digs + b.Digs;
  while (c.Digs > 1 && c.Dig[c.Digs - 1] == 0) c.Digs--;
  return c;
}
BigInt operator*(BigInt const &a, int const &b) {
  BigInt c = a;
  for (int i = 0; i < c.Digs; i++) c.Dig[i] *= b;
  int carry = 0;
  for (int i = 0; i < c.Digs; i++) {
    c.Dig[i] += carry;
    carry = c.Dig[i] / MaxSingle;
    c.Dig[i] -= carry * MaxSingle;
  }
  while (carry > 0) c.Dig[c.Digs++] = carry % MaxSingle, carry /= MaxSingle;
  return c;
}
BigInt operator+(BigInt const &a, int const &b) {
  BigInt c = a;
  int carry = b;
  for (int i = 0; carry > 0; i++) {
    c.Dig[i] += carry;
    carry = c.Dig[i] / MaxSingle;
    c.Dig[i] -= carry * MaxSingle;
    if (i == c.Digs) c.Digs++;
  }
  return c;
}
bool operator<(BigInt const &a, BigInt const &b) {
  if (a.Digs == b.Digs)
    for (int i = a.Digs - 1; i >= 0; i--)
      if (a.Dig[i] != b.Dig[i]) return a.Dig[i] < b.Dig[i];
  return a.Digs < b.Digs;
}
bool operator==(BigInt const &a, BigInt const &b) {
  if (a.Digs != b.Digs) return false;
  for (int i = 0; i < a.Digs; i++)
    if (a.Dig[i] != b.Dig[i]) return false;
  return true;
}
BigInt operator/(BigInt const &a, BigInt const &b) {
  BigInt c, t, m;
  for (int i = 0; i < MaxLen; i++) c.Dig[i] = t.Dig[i] = 0;
  t.Digs = 1;
  for (int i = a.Digs - 1; i >= 0; i--) {
    t = t * MaxSingle;
    t = t + a.Dig[i];
    int left = 0, right = MaxSingle, mid;
    while (left < right - 1) {
      mid = ((left + right) >> 1);
      m = b * mid;
      if (m < t)
        left = mid;
      else if (m == t)
        left = right = mid;
      else
        right = mid;
    }
    m = b * left;
    c.Dig[i] = left;
    t = t - m;
  }
  c.Digs = a.Digs;
  while (c.Digs > 1 && c.Dig[c.Digs - 1] == 0) c.Digs--;
  return c;
}
BigInt operator%(BigInt const &a, BigInt const &b) { return a - (a / b) * b; }
BigInt pow(BigInt const &a, int n) {
  BigInt c, t;
  for (int i = 0; i < MaxLen; i++) c.Dig[i] = 0;
  c.Dig[0] = 1;
  c.Digs = 1;
  t = a;
  while (n > 0) {
    if (n & 1) c = c * t;
    t = t * t;
    n = (n >> 1);
  }
  return c;
}
typedef struct {
  bool isSell;
  int x;
} MSticks;
vector<int> res;
int n;
MSticks allMS[5010];
bool isVisit[5010];
BigInt dp[5010];
int main() {
  scanf("%d", &n);
  string t_s;
  int x;
  int num_s = 0;
  for (int i = 0; i < n; i++) {
    cin >> t_s >> allMS[i].x;
    if (t_s == "win")
      allMS[i].isSell = false;
    else
      allMS[i].isSell = true;
  }
  BigInt num2;
  num2 = "2";
  dp[0] = "0";
  for (int i = 1; i < n; i++) {
    dp[i] = dp[i - 1];
    for (int j = i - 1; j >= 0; j--) {
      if (allMS[i].isSell && !allMS[j].isSell && allMS[i].x == allMS[j].x) {
        if (dp[i] < (dp[j] + pow(num2, allMS[j].x))) {
          dp[i] = dp[j] + pow(num2, allMS[j].x);
        }
      }
    }
  }
  dp[n - 1].Print();
  printf("\n");
  return 0;
}
