import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():

    N = in_n()

    ans = 0

    for i in range(N):
        x, u = readline().rstrip().split()
        x = float(x)
        u = u.decode()
        if u == 'JPY':
            ans += x
        elif u == 'BTC':
            ans += x * 380000

    print(ans)


if __name__ == '__main__':
    main() import sys sys read = sys.stdin.buffer.read read sys.stdin.buffer.read sys.stdin.buffer sys.stdin sys stdin buffer read readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline in_n = lambda: int(readline()) in_n lambda: int(readline()) int(readline()) int readline() readline in_nn = lambda: map(int, readline().split()) in_nn lambda: map(int, readline().split()) map(int, readline().split()) map int readline().split() ().split () readline split in_s = lambda: readline().rstrip().decode('utf-8') in_s lambda: readline().rstrip().decode('utf-8') readline().rstrip().decode('utf-8') ().rstrip().decode ().rstrip() ().rstrip () readline rstrip decode 'utf-8' def main():

    N = in_n()

    ans = 0

    for i in range(N):
        x, u = readline().rstrip().split()
        x = float(x)
        u = u.decode()
        if u == 'JPY':
            ans += x
        elif u == 'BTC':
            ans += x * 380000

    print(ans) main N = in_n() N in_n() in_n ans = 0 ans 0 for i in range(N):
        x, u = readline().rstrip().split()
        x = float(x)
        u = u.decode()
        if u == 'JPY':
            ans += x
        elif u == 'BTC':
            ans += x * 380000

     i range(N) range N x, u = readline().rstrip().split() x readline().rstrip().split() ().rstrip().split ().rstrip() ().rstrip () readline rstrip split u x = float(x) x float(x) float x u = u.decode() u u.decode() u.decode u decode if u == 'JPY':
            ans += x
        elif u == 'BTC':
            ans += x * 380000

     u == 'JPY' u 'JPY' ans += x ans x elif u == 'BTC':
            ans += x * 380000

     u == 'BTC' u 'BTC' ans += x * 380000 ans x * 380000 x 380000 print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline in_s = lambda: readline().rstrip().decode('utf-8') lambda: readline().rstrip().decode('utf-8') in_s def main():

    N = in_n()

    ans = 0

    for i in range(N):
        x, u = readline().rstrip().split()
        x = float(x)
        u = u.decode()
        if u == 'JPY':
            ans += x
        elif u == 'BTC':
            ans += x * 380000

    print(ans) def main():

    N = in_n()

    ans = 0

    for i in range(N):
        x, u = readline().rstrip().split()
        x = float(x)
        u = u.decode()
        if u == 'JPY':
            ans += x
        elif u == 'BTC':
            ans += x * 380000

    print(ans) main in_n = lambda: int(readline()) lambda: int(readline()) in_n in_nn = lambda: map(int, readline().split()) lambda: map(int, readline().split()) in_nn read = sys.stdin.buffer.read sys.stdin.buffer.read read
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():

    N = in_n()

    ans = 0

    for i in range(N):
        x, u = readline().rstrip().split()
        x = float(x)
        u = u.decode()
        if u == 'JPY':
            ans += x
        elif u == 'BTC':
            ans += x * 380000

    print(ans)


if __name__ == '__main__':
    main()
