def main():
    n = int(input())
    gift = 0

    for _ in range(n):
        x, u = input().split()
        if u == "JPY":
            gift += int(x)
        else:
            gift += float(x) * 380000

    print(gift)


if __name__ == "__main__":
    main() def main():
    n = int(input())
    gift = 0

    for _ in range(n):
        x, u = input().split()
        if u == "JPY":
            gift += int(x)
        else:
            gift += float(x) * 380000

    print(gift) main n = int(input()) n int(input()) int input() input gift = 0 gift 0 for _ in range(n):
        x, u = input().split()
        if u == "JPY":
            gift += int(x)
        else:
            gift += float(x) * 380000

     _ range(n) range n x, u = input().split() x input().split() ().split () input split u if u == "JPY":
            gift += int(x)
        else:
            gift += float(x) * 380000

     u == "JPY" u "JPY" gift += int(x) gift int(x) int x gift += float(x) * 380000 gift float(x) * 380000 float(x) float x 380000 print(gift) print gift if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n = int(input())
    gift = 0

    for _ in range(n):
        x, u = input().split()
        if u == "JPY":
            gift += int(x)
        else:
            gift += float(x) * 380000

    print(gift) def main():
    n = int(input())
    gift = 0

    for _ in range(n):
        x, u = input().split()
        if u == "JPY":
            gift += int(x)
        else:
            gift += float(x) * 380000

    print(gift) main
def main():
    n = int(input())
    gift = 0

    for _ in range(n):
        x, u = input().split()
        if u == "JPY":
            gift += int(x)
        else:
            gift += float(x) * 380000

    print(gift)


if __name__ == "__main__":
    main()
