def resolve():
    n = int(input())
    x = [input().split() for i in range(n)]
    count = 0
    for i in x:
        if i[1] == 'BTC':
            count += float(i[0]) * 380000
        else:
            count += int(i[0])
    print(count)
resolve() def resolve():
    n = int(input())
    x = [input().split() for i in range(n)]
    count = 0
    for i in x:
        if i[1] == 'BTC':
            count += float(i[0]) * 380000
        else:
            count += int(i[0])
    print(count) resolve n = int(input()) n int(input()) int input() input input().split() for i in range(n) for i in range(n) i range(n) range n for i in range(n) input().split() ().split () input split x = [input().split() for i in range(n)] x [input().split() for i in range(n)] count = 0 count 0 for i in x:
        if i[1] == 'BTC':
            count += float(i[0]) * 380000
        else:
            count += int(i[0])
     i x if i[1] == 'BTC':
            count += float(i[0]) * 380000
        else:
            count += int(i[0])
     i[1] == 'BTC' i[1] i 1 'BTC' count += float(i[0]) * 380000 count float(i[0]) * 380000 float(i[0]) float i[0] i 0 380000 count += int(i[0]) count int(i[0]) int i[0] i 0 print(count) print count resolve() resolve def resolve():
    n = int(input())
    x = [input().split() for i in range(n)]
    count = 0
    for i in x:
        if i[1] == 'BTC':
            count += float(i[0]) * 380000
        else:
            count += int(i[0])
    print(count) def resolve():
    n = int(input())
    x = [input().split() for i in range(n)]
    count = 0
    for i in x:
        if i[1] == 'BTC':
            count += float(i[0]) * 380000
        else:
            count += int(i[0])
    print(count) resolve
def resolve():
    n = int(input())
    x = [input().split() for i in range(n)]
    count = 0
    for i in x:
        if i[1] == 'BTC':
            count += float(i[0]) * 380000
        else:
            count += int(i[0])
    print(count)
resolve()