n = int(input())
num = 0
for i in range(n):
    x1,v1 = map(str, input().split())
    if v1 == 'JPY':
        num += int(x1)
    else:
        num += float(x1)*380000
print(num) n = int(input()) n int(input()) int input() input num = 0 num 0 for i in range(n):
    x1,v1 = map(str, input().split())
    if v1 == 'JPY':
        num += int(x1)
    else:
        num += float(x1)*380000 i range(n) range n x1,v1 = map(str, input().split()) x1 map(str, input().split()) map str input().split() ().split () input split v1 if v1 == 'JPY':
        num += int(x1)
    else:
        num += float(x1)*380000 v1 == 'JPY' v1 'JPY' num += int(x1) num int(x1) int x1 num += float(x1)*380000 num float(x1)*380000 float(x1) float x1 380000 print(num) print num x1,v1 = map(str, input().split()) map(str, input().split()) x1 num = 0 0 num v1 = map(str, input().split()) map(str, input().split()) v1 n = int(input()) int(input()) n num += int(x1) int(x1) num num += float(x1)*380000 float(x1)*380000 num
n = int(input())
num = 0
for i in range(n):
    x1,v1 = map(str, input().split())
    if v1 == 'JPY':
        num += int(x1)
    else:
        num += float(x1)*380000
print(num)