N = int(input())

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

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