n=int(input())
jp,bi=0,0
for i in range(n):
    x,u=map(str,input().split())
    if u=='JPY':
        jp+=int(x)
    else:
        bi+=float(x)
print(jp+380000*bi) n=int(input()) n int(input()) int input() input jp,bi=0,0 jp 0 bi 0 for i in range(n):
    x,u=map(str,input().split())
    if u=='JPY':
        jp+=int(x)
    else:
        bi+=float(x) i range(n) range n x,u=map(str,input().split()) x map(str,input().split()) map str input().split() ().split () input split u if u=='JPY':
        jp+=int(x)
    else:
        bi+=float(x) u=='JPY' u 'JPY' jp+=int(x) jp int(x) int x bi+=float(x) bi float(x) float x print(jp+380000*bi) print jp+380000*bi jp 380000*bi 380000 bi n=int(input()) int(input()) n u=map(str,input().split()) map(str,input().split()) u bi=0,0 0 bi jp+=int(x) int(x) jp x,u=map(str,input().split()) map(str,input().split()) x jp,bi=0,0 0 jp bi+=float(x) float(x) bi
n=int(input())
jp,bi=0,0
for i in range(n):
    x,u=map(str,input().split())
    if u=='JPY':
        jp+=int(x)
    else:
        bi+=float(x)
print(jp+380000*bi)