n = int(input())
cnt = 0
for _ in range(n):
    x,u = map(str, input().split())
    if u == "JPY":
        cnt += float(x)
    else:
        cnt += float(x) * 380000.0
print(cnt) n = int(input()) n int(input()) int input() input cnt = 0 cnt 0 for _ in range(n):
    x,u = map(str, input().split())
    if u == "JPY":
        cnt += float(x)
    else:
        cnt += float(x) * 380000.0 _ range(n) range n x,u = map(str, input().split()) x map(str, input().split()) map str input().split() ().split () input split u if u == "JPY":
        cnt += float(x)
    else:
        cnt += float(x) * 380000.0 u == "JPY" u "JPY" cnt += float(x) cnt float(x) float x cnt += float(x) * 380000.0 cnt float(x) * 380000.0 float(x) float x 380000.0 print(cnt) print cnt n = int(input()) int(input()) n cnt = 0 0 cnt cnt += float(x) float(x) cnt cnt += float(x) * 380000.0 float(x) * 380000.0 cnt u = map(str, input().split()) map(str, input().split()) u x,u = map(str, input().split()) map(str, input().split()) x
n = int(input())
cnt = 0
for _ in range(n):
    x,u = map(str, input().split())
    if u == "JPY":
        cnt += float(x)
    else:
        cnt += float(x) * 380000.0
print(cnt)