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