from decimal import Decimal

N = int(input())
X = []
U = []
total = Decimal(0)
for _ in range(N):
    x, u = input().split()
    d = Decimal(x)
    if u == "JPY":
        total += d
    else:
        total += d * 380000
print(total)


 from decimal import Decimal N = int(input()) N int(input()) int input() input X = [] X [] U = [] U [] total = Decimal(0) total Decimal(0) Decimal 0 for _ in range(N):
    x, u = input().split()
    d = Decimal(x)
    if u == "JPY":
        total += d
    else:
        total += d * 380000 _ range(N) range N x, u = input().split() x input().split() ().split () input split u d = Decimal(x) d Decimal(x) Decimal x if u == "JPY":
        total += d
    else:
        total += d * 380000 u == "JPY" u "JPY" total += d total d total += d * 380000 total d * 380000 d 380000 print(total) print total total = Decimal(0) Decimal(0) total U = [] [] U d = Decimal(x) Decimal(x) d X = [] [] X u = input().split() input().split() u N = int(input()) int(input()) N x, u = input().split() input().split() x total += d * 380000 d * 380000 total total += d d total
from decimal import Decimal

N = int(input())
X = []
U = []
total = Decimal(0)
for _ in range(N):
    x, u = input().split()
    d = Decimal(x)
    if u == "JPY":
        total += d
    else:
        total += d * 380000
print(total)



