N = int(input())

ans = 0
for i in range(N):
    x, u = map(str,input().split())
    x = float(x)

    if u == "JPY":
        ans += x
    else:
        ans += x * 380000.0

print(ans) N = int(input()) N int(input()) int input() input ans = 0 ans 0 for i in range(N):
    x, u = map(str,input().split())
    x = float(x)

    if u == "JPY":
        ans += x
    else:
        ans += x * 380000.0 i range(N) range N x, u = map(str,input().split()) x map(str,input().split()) map str input().split() ().split () input split u x = float(x) x float(x) float x 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 ans = 0 0 ans N = int(input()) int(input()) N x = float(x) float(x) x x, u = map(str,input().split()) map(str,input().split()) x ans += x x ans ans += x * 380000.0 x * 380000.0 ans u = map(str,input().split()) map(str,input().split()) u
N = int(input())

ans = 0
for i in range(N):
    x, u = map(str,input().split())
    x = float(x)

    if u == "JPY":
        ans += x
    else:
        ans += x * 380000.0

print(ans)