import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n = int(input())

yen = 0
btc = 0.0
for i in range(n):
    x, u = input().split()
    if u == "JPY":
        yen += int(x)
    else:
        btc += float(x)
print(yen + btc * 380000) import sys sys sys.setrecursionlimit(10**7) sys.setrecursionlimit sys setrecursionlimit 10**7 10 7 input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline n = int(input()) n int(input()) int input() input yen = 0 yen 0 btc = 0.0 btc 0.0 for i in range(n):
    x, u = input().split()
    if u == "JPY":
        yen += int(x)
    else:
        btc += float(x) i range(n) range n x, u = input().split() x input().split() ().split () input split u if u == "JPY":
        yen += int(x)
    else:
        btc += float(x) u == "JPY" u "JPY" yen += int(x) yen int(x) int x btc += float(x) btc float(x) float x print(yen + btc * 380000) print yen + btc * 380000 yen btc * 380000 btc 380000 btc = 0.0 0.0 btc yen += int(x) int(x) yen n = int(input()) int(input()) n btc += float(x) float(x) btc yen = 0 0 yen input = sys.stdin.readline sys.stdin.readline input x, u = input().split() input().split() x u = input().split() input().split() u
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n = int(input())

yen = 0
btc = 0.0
for i in range(n):
    x, u = input().split()
    if u == "JPY":
        yen += int(x)
    else:
        btc += float(x)
print(yen + btc * 380000)
