# ABC 119: B – Digital Gifts
N = int(input())

gift = 0

for _ in range(N):
    line = [s for s in input().split()]
    gift += float(line[0]) if line[1] == 'JPY' else 380000.0 * float(line[0])

print(gift) N = int(input()) N int(input()) int input() input gift = 0 gift 0 for _ in range(N):
    line = [s for s in input().split()]
    gift += float(line[0]) if line[1] == 'JPY' else 380000.0 * float(line[0]) _ range(N) range N s for s in input().split() for s in input().split() s input().split() ().split () input split for s in input().split() s line = [s for s in input().split()] line [s for s in input().split()] gift += float(line[0]) if line[1] == 'JPY' else 380000.0 * float(line[0]) gift float(line[0]) if line[1] == 'JPY' else 380000.0 * float(line[0]) line[1] == 'JPY' line[1] line 1 'JPY' float(line[0]) float line[0] line 0 380000.0 * float(line[0]) 380000.0 float(line[0]) float line[0] line 0 print(gift) print gift N = int(input()) int(input()) N gift += float(line[0]) if line[1] == 'JPY' else 380000.0 * float(line[0]) float(line[0]) if line[1] == 'JPY' else 380000.0 * float(line[0]) gift gift = 0 0 gift line = [s for s in input().split()] [s for s in input().split()] line
# ABC 119: B – Digital Gifts
N = int(input())

gift = 0

for _ in range(N):
    line = [s for s in input().split()]
    gift += float(line[0]) if line[1] == 'JPY' else 380000.0 * float(line[0])

print(gift)