#!/usr/bin/env python3

n = int(input())

bit = 380000

ans = 0
for i in range(n):
    value, type_ = list(map(str, input().split()))
    value = float(value)
    if type_ == "JPY":
        ans += value
    else:
        ans += bit*value
print(ans) n = int(input()) n int(input()) int input() input bit = 380000 bit 380000 ans = 0 ans 0 for i in range(n):
    value, type_ = list(map(str, input().split()))
    value = float(value)
    if type_ == "JPY":
        ans += value
    else:
        ans += bit*value i range(n) range n value, type_ = list(map(str, input().split())) value list(map(str, input().split())) list map(str, input().split()) map str input().split() ().split () input split type_ value = float(value) value float(value) float value if type_ == "JPY":
        ans += value
    else:
        ans += bit*value type_ == "JPY" type_ "JPY" ans += value ans value ans += bit*value ans bit*value bit value print(ans) print ans bit = 380000 380000 bit value, type_ = list(map(str, input().split())) list(map(str, input().split())) value n = int(input()) int(input()) n value = float(value) float(value) value ans += bit*value bit*value ans ans += value value ans type_ = list(map(str, input().split())) list(map(str, input().split())) type_ ans = 0 0 ans
#!/usr/bin/env python3

n = int(input())

bit = 380000

ans = 0
for i in range(n):
    value, type_ = list(map(str, input().split()))
    value = float(value)
    if type_ == "JPY":
        ans += value
    else:
        ans += bit*value
print(ans)
