def mapt(fn, *args):
    return tuple(map(fn, *args))
  

def Vector(line):
    return mapt(Atom, line.split(" "))


def Atom(segment):
    try:
        return float(segment)
    except ValueError:
        try:
            int(segment)
        except ValueError:
            return segment

def main():
    n = int(input())
    data = [Vector(input()) for _ in range(n)]
    total = 0
    for amount, currency in data:
        if currency == "JPY":
            total += amount
        else:
            total += amount * 380000
    print(total)

main() def mapt(fn, *args):
    return tuple(map(fn, *args))
   mapt return tuple(map(fn, *args)) tuple(map(fn, *args)) tuple map(fn, *args) map fn *args args fn fn *args def Vector(line):
    return mapt(Atom, line.split(" ")) Vector return mapt(Atom, line.split(" ")) mapt(Atom, line.split(" ")) mapt Atom line.split(" ") line.split line split " " line line def Atom(segment):
    try:
        return float(segment)
    except ValueError:
        try:
            int(segment)
        except ValueError:
            return segment Atom try:
        return float(segment)
    except ValueError:
        try:
            int(segment)
        except ValueError:
            return segment except ValueError:
        try:
            int(segment)
        except ValueError:
            return segment try:
            int(segment)
        except ValueError:
            return segment except ValueError:
            return segment return segment segment int(segment) int segment return float(segment) float(segment) float segment segment segment def main():
    n = int(input())
    data = [Vector(input()) for _ in range(n)]
    total = 0
    for amount, currency in data:
        if currency == "JPY":
            total += amount
        else:
            total += amount * 380000
    print(total) main n = int(input()) n int(input()) int input() input Vector(input()) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) Vector(input()) Vector input() input data = [Vector(input()) for _ in range(n)] data [Vector(input()) for _ in range(n)] total = 0 total 0 for amount, currency in data:
        if currency == "JPY":
            total += amount
        else:
            total += amount * 380000
     amount currency data if currency == "JPY":
            total += amount
        else:
            total += amount * 380000
     currency == "JPY" currency "JPY" total += amount total amount total += amount * 380000 total amount * 380000 amount 380000 print(total) print total main() main def main():
    n = int(input())
    data = [Vector(input()) for _ in range(n)]
    total = 0
    for amount, currency in data:
        if currency == "JPY":
            total += amount
        else:
            total += amount * 380000
    print(total) def main():
    n = int(input())
    data = [Vector(input()) for _ in range(n)]
    total = 0
    for amount, currency in data:
        if currency == "JPY":
            total += amount
        else:
            total += amount * 380000
    print(total) main def mapt(fn, *args):
    return tuple(map(fn, *args))
   def mapt(fn, *args):
    return tuple(map(fn, *args))
   mapt def Vector(line):
    return mapt(Atom, line.split(" ")) def Vector(line):
    return mapt(Atom, line.split(" ")) Vector def Atom(segment):
    try:
        return float(segment)
    except ValueError:
        try:
            int(segment)
        except ValueError:
            return segment def Atom(segment):
    try:
        return float(segment)
    except ValueError:
        try:
            int(segment)
        except ValueError:
            return segment Atom
def mapt(fn, *args):
    return tuple(map(fn, *args))
  

def Vector(line):
    return mapt(Atom, line.split(" "))


def Atom(segment):
    try:
        return float(segment)
    except ValueError:
        try:
            int(segment)
        except ValueError:
            return segment

def main():
    n = int(input())
    data = [Vector(input()) for _ in range(n)]
    total = 0
    for amount, currency in data:
        if currency == "JPY":
            total += amount
        else:
            total += amount * 380000
    print(total)

main()