def main():
    N = int(input())
    data = [input().split() for _ in range(N)]
    sum = 0
    for d in data:
        if d[1] == "JPY":
            sum += int(d[0])
        else:
            sum += float(d[0]) * 380000
    print(sum)


if __name__ == '__main__':
    main() def main():
    N = int(input())
    data = [input().split() for _ in range(N)]
    sum = 0
    for d in data:
        if d[1] == "JPY":
            sum += int(d[0])
        else:
            sum += float(d[0]) * 380000
    print(sum) 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 data = [input().split() for _ in range(N)] data [input().split() for _ in range(N)] sum = 0 sum 0 for d in data:
        if d[1] == "JPY":
            sum += int(d[0])
        else:
            sum += float(d[0]) * 380000
     d data if d[1] == "JPY":
            sum += int(d[0])
        else:
            sum += float(d[0]) * 380000
     d[1] == "JPY" d[1] d 1 "JPY" sum += int(d[0]) sum int(d[0]) int d[0] d 0 sum += float(d[0]) * 380000 sum float(d[0]) * 380000 float(d[0]) float d[0] d 0 380000 print(sum) print sum if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N = int(input())
    data = [input().split() for _ in range(N)]
    sum = 0
    for d in data:
        if d[1] == "JPY":
            sum += int(d[0])
        else:
            sum += float(d[0]) * 380000
    print(sum) def main():
    N = int(input())
    data = [input().split() for _ in range(N)]
    sum = 0
    for d in data:
        if d[1] == "JPY":
            sum += int(d[0])
        else:
            sum += float(d[0]) * 380000
    print(sum) main
def main():
    N = int(input())
    data = [input().split() for _ in range(N)]
    sum = 0
    for d in data:
        if d[1] == "JPY":
            sum += int(d[0])
        else:
            sum += float(d[0]) * 380000
    print(sum)


if __name__ == '__main__':
    main()
