n = int(input())
a = 0
for _ in range(n):
    x, u = map(str, input().split())
    if u == 'JPY':
        a += int(x)
    else:
        a += float(x) * 380000
print(a) n = int(input()) n int(input()) int input() input a = 0 a 0 for _ in range(n):
    x, u = map(str, input().split())
    if u == 'JPY':
        a += int(x)
    else:
        a += float(x) * 380000 _ 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':
        a += int(x)
    else:
        a += float(x) * 380000 u == 'JPY' u 'JPY' a += int(x) a int(x) int x a += float(x) * 380000 a float(x) * 380000 float(x) float x 380000 print(a) print a a = 0 0 a u = map(str, input().split()) map(str, input().split()) u a += float(x) * 380000 float(x) * 380000 a n = int(input()) int(input()) n a += int(x) int(x) a x, u = map(str, input().split()) map(str, input().split()) x
n = int(input())
a = 0
for _ in range(n):
    x, u = map(str, input().split())
    if u == 'JPY':
        a += int(x)
    else:
        a += float(x) * 380000
print(a)