import sys
def input(): return sys.stdin.readline().strip()

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


if __name__ == "__main__":
    main() import sys sys def input(): return sys.stdin.readline().strip() input def main():
    N = int(input())
    money = 0
    for _ in range(N):
        x, u = input().split()
        if u == "JPY": money += int(x)
        else: money += float(x) * 380000
    print(money) main N = int(input()) N int(input()) int input() input money = 0 money 0 for _ in range(N):
        x, u = input().split()
        if u == "JPY": money += int(x)
        else: money += float(x) * 380000
     _ range(N) range N x, u = input().split() x input().split() ().split () input split u if u == "JPY": money += int(x)
        else: money += float(x) * 380000
     u == "JPY" u "JPY" print(money) print money if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def input(): return sys.stdin.readline().strip() def input(): return sys.stdin.readline().strip() input def main():
    N = int(input())
    money = 0
    for _ in range(N):
        x, u = input().split()
        if u == "JPY": money += int(x)
        else: money += float(x) * 380000
    print(money) def main():
    N = int(input())
    money = 0
    for _ in range(N):
        x, u = input().split()
        if u == "JPY": money += int(x)
        else: money += float(x) * 380000
    print(money) main
import sys
def input(): return sys.stdin.readline().strip()

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


if __name__ == "__main__":
    main()
