from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    n = int(input())
    count = 0

    for i in range(n):
        b, c = map(str, input().split())
        if c =="JPY":
            count+=int(b)
        else:
            count+=  Decimal(380000 ) * Decimal(b)

    print(count)
 from decimal import * import numpy as np numpy import math math if __name__ == '__main__':
    n = int(input())
    count = 0

    for i in range(n):
        b, c = map(str, input().split())
        if c =="JPY":
            count+=int(b)
        else:
            count+=  Decimal(380000 ) * Decimal(b)

    print(count) __name__ == '__main__' __name__ '__main__' n = int(input()) n int(input()) int input() input count = 0 count 0 for i in range(n):
        b, c = map(str, input().split())
        if c =="JPY":
            count+=int(b)
        else:
            count+=  Decimal(380000 ) * Decimal(b)

     i range(n) range n b, c = map(str, input().split()) b map(str, input().split()) map str input().split() ().split () input split c if c =="JPY":
            count+=int(b)
        else:
            count+=  Decimal(380000 ) * Decimal(b)

     c =="JPY" c "JPY" count+=int(b) count int(b) int b count+=  Decimal(380000 ) * Decimal(b) count Decimal(380000 ) * Decimal(b) Decimal(380000 ) Decimal 380000 Decimal(b) Decimal b print(count) print count b, c = map(str, input().split()) map(str, input().split()) b count = 0 0 count n = int(input()) int(input()) n c = map(str, input().split()) map(str, input().split()) c count+=  Decimal(380000 ) * Decimal(b) Decimal(380000 ) * Decimal(b) count count+=int(b) int(b) count
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    n = int(input())
    count = 0

    for i in range(n):
        b, c = map(str, input().split())
        if c =="JPY":
            count+=int(b)
        else:
            count+=  Decimal(380000 ) * Decimal(b)

    print(count)

