from decimal import Decimal
def main():
    n = int(input())
    xu = [input().split() for _ in range(n)]
    c = Decimal("0")
    for x,u in xu:
        if u == "JPY":
            c += Decimal(x)
        else:
            c += Decimal(x)*Decimal("380000.0")
    print(c)
    
if __name__ == "__main__":
    main() from decimal import Decimal def main():
    n = int(input())
    xu = [input().split() for _ in range(n)]
    c = Decimal("0")
    for x,u in xu:
        if u == "JPY":
            c += Decimal(x)
        else:
            c += Decimal(x)*Decimal("380000.0")
    print(c)
     main n = int(input()) n int(input()) int input() input input().split() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) input().split() ().split () input split xu = [input().split() for _ in range(n)] xu [input().split() for _ in range(n)] c = Decimal("0") c Decimal("0") Decimal "0" for x,u in xu:
        if u == "JPY":
            c += Decimal(x)
        else:
            c += Decimal(x)*Decimal("380000.0")
     x u xu if u == "JPY":
            c += Decimal(x)
        else:
            c += Decimal(x)*Decimal("380000.0")
     u == "JPY" u "JPY" c += Decimal(x) c Decimal(x) Decimal x c += Decimal(x)*Decimal("380000.0") c Decimal(x)*Decimal("380000.0") Decimal(x) Decimal x Decimal("380000.0") Decimal "380000.0" print(c) print c if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n = int(input())
    xu = [input().split() for _ in range(n)]
    c = Decimal("0")
    for x,u in xu:
        if u == "JPY":
            c += Decimal(x)
        else:
            c += Decimal(x)*Decimal("380000.0")
    print(c)
     def main():
    n = int(input())
    xu = [input().split() for _ in range(n)]
    c = Decimal("0")
    for x,u in xu:
        if u == "JPY":
            c += Decimal(x)
        else:
            c += Decimal(x)*Decimal("380000.0")
    print(c)
     main
from decimal import Decimal
def main():
    n = int(input())
    xu = [input().split() for _ in range(n)]
    c = Decimal("0")
    for x,u in xu:
        if u == "JPY":
            c += Decimal(x)
        else:
            c += Decimal(x)*Decimal("380000.0")
    print(c)
    
if __name__ == "__main__":
    main()