N = int(input())
xu = []
for i in range(N):
    xu.append(list(input().split()))
#print(xu)

wa = 0
for i in range(N):
     if xu[i][1] == 'JPY':
         wa += int(xu[i][0])
     elif xu[i][1] == 'BTC':
         wa += float(xu[i][0]) * 380000
print(wa) N = int(input()) N int(input()) int input() input xu = [] xu [] for i in range(N):
    xu.append(list(input().split()))
#print(xu) i range(N) range N xu.append(list(input().split())) xu.append xu append list(input().split()) list input().split() ().split () input split wa = 0 wa 0 for i in range(N):
     if xu[i][1] == 'JPY':
         wa += int(xu[i][0])
     elif xu[i][1] == 'BTC':
         wa += float(xu[i][0]) * 380000 i range(N) range N if xu[i][1] == 'JPY':
         wa += int(xu[i][0])
     elif xu[i][1] == 'BTC':
         wa += float(xu[i][0]) * 380000 xu[i][1] == 'JPY' xu[i][1] [i] xu i 1 'JPY' wa += int(xu[i][0]) wa int(xu[i][0]) int xu[i][0] [i] xu i 0 elif xu[i][1] == 'BTC':
         wa += float(xu[i][0]) * 380000 xu[i][1] == 'BTC' xu[i][1] [i] xu i 1 'BTC' wa += float(xu[i][0]) * 380000 wa float(xu[i][0]) * 380000 float(xu[i][0]) float xu[i][0] [i] xu i 0 380000 print(wa) print wa N = int(input()) int(input()) N xu = [] [] xu wa += int(xu[i][0]) int(xu[i][0]) wa wa = 0 0 wa wa += float(xu[i][0]) * 380000 float(xu[i][0]) * 380000 wa
N = int(input())
xu = []
for i in range(N):
    xu.append(list(input().split()))
#print(xu)

wa = 0
for i in range(N):
     if xu[i][1] == 'JPY':
         wa += int(xu[i][0])
     elif xu[i][1] == 'BTC':
         wa += float(xu[i][0]) * 380000
print(wa)