N = int(input())
sum_otoshidama = 0
for _ in range(N):
    x, u = input().split()
    if u == 'JPY':
        sum_otoshidama += float(x)
    elif u == 'BTC':
        sum_otoshidama += (float(x) * 380000)
print(sum_otoshidama) N = int(input()) N int(input()) int input() input sum_otoshidama = 0 sum_otoshidama 0 for _ in range(N):
    x, u = input().split()
    if u == 'JPY':
        sum_otoshidama += float(x)
    elif u == 'BTC':
        sum_otoshidama += (float(x) * 380000) _ range(N) range N x, u = input().split() x input().split() ().split () input split u if u == 'JPY':
        sum_otoshidama += float(x)
    elif u == 'BTC':
        sum_otoshidama += (float(x) * 380000) u == 'JPY' u 'JPY' sum_otoshidama += float(x) sum_otoshidama float(x) float x elif u == 'BTC':
        sum_otoshidama += (float(x) * 380000) u == 'BTC' u 'BTC' sum_otoshidama += (float(x) * 380000) sum_otoshidama float(x) * 380000 float(x) float x 380000 print(sum_otoshidama) print sum_otoshidama u = input().split() input().split() u sum_otoshidama += float(x) float(x) sum_otoshidama x, u = input().split() input().split() x sum_otoshidama += (float(x) * 380000) float(x) * 380000 sum_otoshidama N = int(input()) int(input()) N sum_otoshidama = 0 0 sum_otoshidama
N = int(input())
sum_otoshidama = 0
for _ in range(N):
    x, u = input().split()
    if u == 'JPY':
        sum_otoshidama += float(x)
    elif u == 'BTC':
        sum_otoshidama += (float(x) * 380000)
print(sum_otoshidama)
