import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
J = 0
B = 0
for _ in range(N):
    x, u  = map(str, input().split())
    if u == 'JPY':
        J += int(x)
    else:
        B += float(x)
ans = J + 380000*B
print(ans) import bisect,collections,copy,heapq,itertools,math,string bisect collections copy heapq itertools math string import sys sys def S(): return sys.stdin.readline().rstrip() S def M(): return map(int,sys.stdin.readline().rstrip().split()) M def I(): return int(sys.stdin.readline().rstrip()) I def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) LI def LS(): return list(sys.stdin.readline().rstrip().split()) LS N = I() N I() I J = 0 J 0 B = 0 B 0 for _ in range(N):
    x, u  = map(str, input().split())
    if u == 'JPY':
        J += int(x)
    else:
        B += float(x) _ range(N) range N x, u  = map(str, input().split()) x map(str, input().split()) map str 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 ans = J + 380000*B ans J + 380000*B J 380000*B 380000 B print(ans) print ans J = 0 0 J J += int(x) int(x) J def M(): return map(int,sys.stdin.readline().rstrip().split()) def M(): return map(int,sys.stdin.readline().rstrip().split()) M def I(): return int(sys.stdin.readline().rstrip()) def I(): return int(sys.stdin.readline().rstrip()) I B = 0 0 B B += float(x) float(x) B N = I() I() N def LS(): return list(sys.stdin.readline().rstrip().split()) def LS(): return list(sys.stdin.readline().rstrip().split()) LS u  = map(str, input().split()) map(str, input().split()) u def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) LI x, u  = map(str, input().split()) map(str, input().split()) x ans = J + 380000*B J + 380000*B ans def S(): return sys.stdin.readline().rstrip() def S(): return sys.stdin.readline().rstrip() S
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
J = 0
B = 0
for _ in range(N):
    x, u  = map(str, input().split())
    if u == 'JPY':
        J += int(x)
    else:
        B += float(x)
ans = J + 380000*B
print(ans)