def resolve():
    N = int(input())
    ans = 0
    for i in range(N):
        x, u = input().split()
        x = float(x)
        if u == "JPY":
            ans += x
        else:
            ans += x*380000
    print(ans)

if '__main__' == __name__:
    resolve() def resolve():
    N = int(input())
    ans = 0
    for i in range(N):
        x, u = input().split()
        x = float(x)
        if u == "JPY":
            ans += x
        else:
            ans += x*380000
    print(ans) resolve N = int(input()) N int(input()) int input() input ans = 0 ans 0 for i in range(N):
        x, u = input().split()
        x = float(x)
        if u == "JPY":
            ans += x
        else:
            ans += x*380000
     i range(N) range N x, u = input().split() x input().split() ().split () input split u x = float(x) x float(x) float x if u == "JPY":
            ans += x
        else:
            ans += x*380000
     u == "JPY" u "JPY" ans += x ans x ans += x*380000 ans x*380000 x 380000 print(ans) print ans if '__main__' == __name__:
    resolve() '__main__' == __name__ '__main__' __name__ resolve() resolve def resolve():
    N = int(input())
    ans = 0
    for i in range(N):
        x, u = input().split()
        x = float(x)
        if u == "JPY":
            ans += x
        else:
            ans += x*380000
    print(ans) def resolve():
    N = int(input())
    ans = 0
    for i in range(N):
        x, u = input().split()
        x = float(x)
        if u == "JPY":
            ans += x
        else:
            ans += x*380000
    print(ans) resolve
def resolve():
    N = int(input())
    ans = 0
    for i in range(N):
        x, u = input().split()
        x = float(x)
        if u == "JPY":
            ans += x
        else:
            ans += x*380000
    print(ans)

if '__main__' == __name__:
    resolve()