N = int(input())
cost = []
yen = []
for i in range(N):
    n, a = input().split()
    cost.append(float(n))
    yen.append(a)
ans = 0
for i in range(N):
    if yen[i] == "JPY":
        ans += cost[i]
    else:
        ans += cost[i] * 380000
print(ans) N = int(input()) N int(input()) int input() input cost = [] cost [] yen = [] yen [] for i in range(N):
    n, a = input().split()
    cost.append(float(n))
    yen.append(a) i range(N) range N n, a = input().split() n input().split() ().split () input split a cost.append(float(n)) cost.append cost append float(n) float n yen.append(a) yen.append yen append a ans = 0 ans 0 for i in range(N):
    if yen[i] == "JPY":
        ans += cost[i]
    else:
        ans += cost[i] * 380000 i range(N) range N if yen[i] == "JPY":
        ans += cost[i]
    else:
        ans += cost[i] * 380000 yen[i] == "JPY" yen[i] yen i "JPY" ans += cost[i] ans cost[i] cost i ans += cost[i] * 380000 ans cost[i] * 380000 cost[i] cost i 380000 print(ans) print ans ans += cost[i] * 380000 cost[i] * 380000 ans ans = 0 0 ans n, a = input().split() input().split() n yen = [] [] yen N = int(input()) int(input()) N cost = [] [] cost a = input().split() input().split() a ans += cost[i] cost[i] ans
N = int(input())
cost = []
yen = []
for i in range(N):
    n, a = input().split()
    cost.append(float(n))
    yen.append(a)
ans = 0
for i in range(N):
    if yen[i] == "JPY":
        ans += cost[i]
    else:
        ans += cost[i] * 380000
print(ans)