C = 380000.0

ans = 0.0
n = int(input())
for i in range(n):
    x, u = input().split()
    if u == 'JPY':
        ans += int(x)
    else:
        ans += float(x) * C
print(ans) C = 380000.0 C 380000.0 ans = 0.0 ans 0.0 n = int(input()) n int(input()) int input() input for i in range(n):
    x, u = input().split()
    if u == 'JPY':
        ans += int(x)
    else:
        ans += float(x) * C i range(n) range n x, u = input().split() x input().split() ().split () input split u if u == 'JPY':
        ans += int(x)
    else:
        ans += float(x) * C u == 'JPY' u 'JPY' ans += int(x) ans int(x) int x ans += float(x) * C ans float(x) * C float(x) float x C print(ans) print ans ans = 0.0 0.0 ans u = input().split() input().split() u n = int(input()) int(input()) n ans += int(x) int(x) ans ans += float(x) * C float(x) * C ans C = 380000.0 380000.0 C x, u = input().split() input().split() x
C = 380000.0

ans = 0.0
n = int(input())
for i in range(n):
    x, u = input().split()
    if u == 'JPY':
        ans += int(x)
    else:
        ans += float(x) * C
print(ans)
