n=int(input())
kei = 0.0
for i in range(n):
    x,u=map(str,input().split())
    if u=="JPY":
        kei += float(x)
    else:
        kei += float(x)*380000.0
print(kei) n=int(input()) n int(input()) int input() input kei = 0.0 kei 0.0 for i in range(n):
    x,u=map(str,input().split())
    if u=="JPY":
        kei += float(x)
    else:
        kei += float(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 if u=="JPY":
        kei += float(x)
    else:
        kei += float(x)*380000.0 u=="JPY" u "JPY" kei += float(x) kei float(x) float x kei += float(x)*380000.0 kei float(x)*380000.0 float(x) float x 380000.0 print(kei) print kei kei = 0.0 0.0 kei x,u=map(str,input().split()) map(str,input().split()) x u=map(str,input().split()) map(str,input().split()) u n=int(input()) int(input()) n kei += float(x) float(x) kei kei += float(x)*380000.0 float(x)*380000.0 kei
n=int(input())
kei = 0.0
for i in range(n):
    x,u=map(str,input().split())
    if u=="JPY":
        kei += float(x)
    else:
        kei += float(x)*380000.0
print(kei)