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