j = 0
b = 0

n = int(input())

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

n = int(input())

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