import sys
inp = sys.stdin.buffer.readline

ans = 0
N = int(inp())
for i in range(N):
    X = list(input().split())
    if X[1] == 'JPY':
        ans += int(X[0])
    else:
        ans += 380000 * float(X[0])
print(ans) import sys sys inp = sys.stdin.buffer.readline inp sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline ans = 0 ans 0 N = int(inp()) N int(inp()) int inp() inp for i in range(N):
    X = list(input().split())
    if X[1] == 'JPY':
        ans += int(X[0])
    else:
        ans += 380000 * float(X[0]) i range(N) range N X = list(input().split()) X list(input().split()) list input().split() ().split () input split if X[1] == 'JPY':
        ans += int(X[0])
    else:
        ans += 380000 * float(X[0]) X[1] == 'JPY' X[1] X 1 'JPY' ans += int(X[0]) ans int(X[0]) int X[0] X 0 ans += 380000 * float(X[0]) ans 380000 * float(X[0]) 380000 float(X[0]) float X[0] X 0 print(ans) print ans ans += 380000 * float(X[0]) 380000 * float(X[0]) ans inp = sys.stdin.buffer.readline sys.stdin.buffer.readline inp ans = 0 0 ans ans += int(X[0]) int(X[0]) ans N = int(inp()) int(inp()) N X = list(input().split()) list(input().split()) X
import sys
inp = sys.stdin.buffer.readline

ans = 0
N = int(inp())
for i in range(N):
    X = list(input().split())
    if X[1] == 'JPY':
        ans += int(X[0])
    else:
        ans += 380000 * float(X[0])
print(ans)