n = int(input())
output = 0
for i in range(n):
    x,u = map(str,input().split())
    if u == "JPY":
        output += int(x)
    else:
        output = output + 380000 * float(x)
print(output) n = int(input()) n int(input()) int input() input output = 0 output 0 for i in range(n):
    x,u = map(str,input().split())
    if u == "JPY":
        output += int(x)
    else:
        output = output + 380000 * float(x) i 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":
        output += int(x)
    else:
        output = output + 380000 * float(x) u == "JPY" u "JPY" output += int(x) output int(x) int x output = output + 380000 * float(x) output output + 380000 * float(x) output 380000 * float(x) 380000 float(x) float x print(output) print output n = int(input()) int(input()) n output = output + 380000 * float(x) output + 380000 * float(x) output u = map(str,input().split()) map(str,input().split()) u output += int(x) int(x) output output = 0 0 output x,u = map(str,input().split()) map(str,input().split()) x
n = int(input())
output = 0
for i in range(n):
    x,u = map(str,input().split())
    if u == "JPY":
        output += int(x)
    else:
        output = output + 380000 * float(x)
print(output)