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