n = int(input())
ans = 0
for _ in range(n):
    m,t = input().split()
    m = float(m)
    if t == 'JPY':ans+=m
    else:ans+= m*380000.0
print(ans)
  n = int(input()) n int(input()) int input() input ans = 0 ans 0 for _ in range(n):
    m,t = input().split()
    m = float(m)
    if t == 'JPY':ans+=m
    else:ans+= m*380000.0 _ range(n) range n m,t = input().split() m input().split() ().split () input split t m = float(m) m float(m) float m if t == 'JPY':ans+=m
    else:ans+= m*380000.0 t == 'JPY' t 'JPY' print(ans) print ans t = input().split() input().split() t ans = 0 0 ans n = int(input()) int(input()) n m = float(m) float(m) m m,t = input().split() input().split() m
n = int(input())
ans = 0
for _ in range(n):
    m,t = input().split()
    m = float(m)
    if t == 'JPY':ans+=m
    else:ans+= m*380000.0
print(ans)
 
