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