N = int(input())
ans = 0.0
for _ in range(N):
    xs, u = input().split()
    x = float(xs)
    if u == "JPY":
        ans += x
    else:
        ans += x * 380000.0
print(ans) N = int(input()) N int(input()) int input() input ans = 0.0 ans 0.0 for _ in range(N):
    xs, u = input().split()
    x = float(xs)
    if u == "JPY":
        ans += x
    else:
        ans += x * 380000.0 _ range(N) range N xs, u = input().split() xs input().split() ().split () input split u x = float(xs) x float(xs) float xs if u == "JPY":
        ans += x
    else:
        ans += x * 380000.0 u == "JPY" u "JPY" ans += x ans x ans += x * 380000.0 ans x * 380000.0 x 380000.0 print(ans) print ans xs, u = input().split() input().split() xs ans += x x ans ans += x * 380000.0 x * 380000.0 ans N = int(input()) int(input()) N x = float(xs) float(xs) x u = input().split() input().split() u ans = 0.0 0.0 ans
N = int(input())
ans = 0.0
for _ in range(N):
    xs, u = input().split()
    x = float(xs)
    if u == "JPY":
        ans += x
    else:
        ans += x * 380000.0
print(ans)