N = int(input())

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

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