/*
主要有以下方法可以使用: BigInteger add(BigInteger other)
BigInteger subtract(BigInteger other)
BigInteger multiply(BigInteger other)
BigInteger divide(BigInteger other)
BigInteger mod(BigInteger other)
int compareTo(BigInteger other)
static BigInteger valueOf(long x)
BigInteger dp[] = new BigInteger[5010];
*/
import java.math.*;
import java.util.*;
import java.io.*;
public class Main {
static public void main(String args[]) {
Scanner cin = new Scanner(System.in);
int N = cin.nextInt();
String st[] = new String[5010];
int a[] = new int[5010];
BigInteger dp[] = new BigInteger[5010];
dp[0] = new BigInteger("0");
for (int i=1; i<=N; i++) {
st[i] = cin.next();
a[i] = cin.nextInt();
if (st[i].compareTo("win") == 0) {
dp[i] = dp[i-1];
} else {
dp[i] = dp[i-1];
for (int j=i-1; j>0; j--)
if (st[j].compareTo("win")==0 && a[j] == a[i]) {
BigInteger temp = new BigInteger("2");
temp = temp.pow(a[j]);
temp = temp.add(dp[j]);
if (temp.compareTo(dp[i]) == 1)
dp[i] = temp;
j = 1;
}
}
}
System.out.println(dp[N]);
}
}
* BigInteger a = BigInteger.valueOf(100);
* BigInteger b = BigInteger.valueOf(50);
* BigInteger c = a.add(b) // c = a + b;主要有以下方法可以使用: BigInteger add(BigInteger other)
BigInteger subtract(BigInteger other)
BigInteger multiply(BigInteger other)
BigInteger divide(BigInteger other)
BigInteger mod(BigInteger other)
int compareTo(BigInteger other)
static BigInteger valueOf(long x)
BigInteger dp[] = new BigInteger[5010];
*/
import java.math.*;
import java.util.*;
import java.io.*;
public class Main {
static public void main(String args[]) {
Scanner cin = new Scanner(System.in);
int N = cin.nextInt();
String st[] = new String[5010];
int a[] = new int[5010];
BigInteger dp[] = new BigInteger[5010];
dp[0] = new BigInteger("0");
for (int i=1; i<=N; i++) {
st[i] = cin.next();
a[i] = cin.nextInt();
if (st[i].compareTo("win") == 0) {
dp[i] = dp[i-1];
} else {
dp[i] = dp[i-1];
for (int j=i-1; j>0; j--)
if (st[j].compareTo("win")==0 && a[j] == a[i]) {
BigInteger temp = new BigInteger("2");
temp = temp.pow(a[j]);
temp = temp.add(dp[j]);
if (temp.compareTo(dp[i]) == 1)
dp[i] = temp;
j = 1;
}
}
}
System.out.println(dp[N]);
}
}