import sys

input = sys.stdin.readline


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

    print(ans)


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

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

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

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

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

    print(ans) main input = sys.stdin.readline sys.stdin.readline input
import sys

input = sys.stdin.readline


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

    print(ans)


if __name__ == "__main__":
    main()
