import itertools
import math
import fractions
import functools
import copy
n = int(input())
x = []
u = []
for i in range(n):
    a, b = input().split()
    x.append(float(a))
    u.append(b)

sum = 0
for i in range(n):
    if u[i] == "JPY":
        sum += x[i]
    else:
        sum += x[i]*380000

print(sum) import itertools itertools import math math import fractions fractions import functools functools import copy copy n = int(input()) n int(input()) int input() input x = [] x [] u = [] u [] for i in range(n):
    a, b = input().split()
    x.append(float(a))
    u.append(b) i range(n) range n a, b = input().split() a input().split() ().split () input split b x.append(float(a)) x.append x append float(a) float a u.append(b) u.append u append b sum = 0 sum 0 for i in range(n):
    if u[i] == "JPY":
        sum += x[i]
    else:
        sum += x[i]*380000 i range(n) range n if u[i] == "JPY":
        sum += x[i]
    else:
        sum += x[i]*380000 u[i] == "JPY" u[i] u i "JPY" sum += x[i] sum x[i] x i sum += x[i]*380000 sum x[i]*380000 x[i] x i 380000 print(sum) print sum u = [] [] u a, b = input().split() input().split() a sum += x[i] x[i] sum sum = 0 0 sum x = [] [] x sum += x[i]*380000 x[i]*380000 sum n = int(input()) int(input()) n b = input().split() input().split() b
import itertools
import math
import fractions
import functools
import copy
n = int(input())
x = []
u = []
for i in range(n):
    a, b = input().split()
    x.append(float(a))
    u.append(b)

sum = 0
for i in range(n):
    if u[i] == "JPY":
        sum += x[i]
    else:
        sum += x[i]*380000

print(sum)