ii = lambda:int(input())
mi = lambda:list(map(int,input().split()))
ix = lambda x:list(input() for _ in range(x))
mix = lambda x:list(mi() for _ in range(x))
iix = lambda x:list(int(input()) for _ in range(x))
##########
def main(n,l):
    res = 0
    for x,u in l:
        res += calc(x,u)
    return res
    
def calc(x,u):
    return int(x) if u == "JPY" else float(x) * 380000

n = ii()
l = list([input().split() for _ in range(n)])
print(main(n,l)) ii = lambda:int(input()) ii lambda:int(input()) int(input()) int input() input mi = lambda:list(map(int,input().split())) mi lambda:list(map(int,input().split())) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ix = lambda x:list(input() for _ in range(x)) ix lambda x:list(input() for _ in range(x)) list(input() for _ in range(x)) list input() input x mix = lambda x:list(mi() for _ in range(x)) mix lambda x:list(mi() for _ in range(x)) list(mi() for _ in range(x)) list mi() mi x iix = lambda x:list(int(input()) for _ in range(x)) iix lambda x:list(int(input()) for _ in range(x)) list(int(input()) for _ in range(x)) list int(input()) int input() input x def main(n,l):
    res = 0
    for x,u in l:
        res += calc(x,u)
    return res
     main res = 0 res 0 for x,u in l:
        res += calc(x,u)
     x u l res += calc(x,u) res calc(x,u) calc x u return res res n n l l def calc(x,u):
    return int(x) if u == "JPY" else float(x) * 380000 calc return int(x) if u == "JPY" else float(x) * 380000 int(x) if u == "JPY" else float(x) * 380000 u == "JPY" u "JPY" int(x) int x float(x) * 380000 float(x) float x 380000 x x u u n = ii() n ii() ii input().split() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) input().split() ().split () input split l = list([input().split() for _ in range(n)]) l list([input().split() for _ in range(n)]) list [input().split() for _ in range(n)] print(main(n,l)) print main(n,l) main n l ii = lambda:int(input()) lambda:int(input()) ii mi = lambda:list(map(int,input().split())) lambda:list(map(int,input().split())) mi def main(n,l):
    res = 0
    for x,u in l:
        res += calc(x,u)
    return res
     def main(n,l):
    res = 0
    for x,u in l:
        res += calc(x,u)
    return res
     main mix = lambda x:list(mi() for _ in range(x)) lambda x:list(mi() for _ in range(x)) mix def calc(x,u):
    return int(x) if u == "JPY" else float(x) * 380000 def calc(x,u):
    return int(x) if u == "JPY" else float(x) * 380000 calc ix = lambda x:list(input() for _ in range(x)) lambda x:list(input() for _ in range(x)) ix n = ii() ii() n iix = lambda x:list(int(input()) for _ in range(x)) lambda x:list(int(input()) for _ in range(x)) iix l = list([input().split() for _ in range(n)]) list([input().split() for _ in range(n)]) l
ii = lambda:int(input())
mi = lambda:list(map(int,input().split()))
ix = lambda x:list(input() for _ in range(x))
mix = lambda x:list(mi() for _ in range(x))
iix = lambda x:list(int(input()) for _ in range(x))
##########
def main(n,l):
    res = 0
    for x,u in l:
        res += calc(x,u)
    return res
    
def calc(x,u):
    return int(x) if u == "JPY" else float(x) * 380000

n = ii()
l = list([input().split() for _ in range(n)])
print(main(n,l))