n = int(input())
ret = 0
for i in range(n):
    x, v = input().split()
    if v == 'JPY':
        ret += int(x)
    else:
        ret += float(x)*380000

print(ret) n = int(input()) n int(input()) int input() input ret = 0 ret 0 for i in range(n):
    x, v = input().split()
    if v == 'JPY':
        ret += int(x)
    else:
        ret += float(x)*380000 i range(n) range n x, v = input().split() x input().split() ().split () input split v if v == 'JPY':
        ret += int(x)
    else:
        ret += float(x)*380000 v == 'JPY' v 'JPY' ret += int(x) ret int(x) int x ret += float(x)*380000 ret float(x)*380000 float(x) float x 380000 print(ret) print ret v = input().split() input().split() v x, v = input().split() input().split() x ret += float(x)*380000 float(x)*380000 ret n = int(input()) int(input()) n ret += int(x) int(x) ret ret = 0 0 ret
n = int(input())
ret = 0
for i in range(n):
    x, v = input().split()
    if v == 'JPY':
        ret += int(x)
    else:
        ret += float(x)*380000

print(ret)