n = int(input())
sum = 0

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

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