import sys


def input():
    return sys.stdin.readline().rstrip()


def main():
    BB=380000
    ans =0
    N =int(input())

    for i in range(N):
        x,v =input().split()
        if v =="JPY":
            ans +=int(x)
        else:
            ans +=BB*float(x)

    print(ans)


if __name__ == "__main__":
    main() import sys sys def input():
    return sys.stdin.readline().rstrip() input return sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def main():
    BB=380000
    ans =0
    N =int(input())

    for i in range(N):
        x,v =input().split()
        if v =="JPY":
            ans +=int(x)
        else:
            ans +=BB*float(x)

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

     i range(N) range N x,v =input().split() x input().split() ().split () input split v if v =="JPY":
            ans +=int(x)
        else:
            ans +=BB*float(x)

     v =="JPY" v "JPY" ans +=int(x) ans int(x) int x ans +=BB*float(x) ans BB*float(x) BB float(x) float x print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    BB=380000
    ans =0
    N =int(input())

    for i in range(N):
        x,v =input().split()
        if v =="JPY":
            ans +=int(x)
        else:
            ans +=BB*float(x)

    print(ans) def main():
    BB=380000
    ans =0
    N =int(input())

    for i in range(N):
        x,v =input().split()
        if v =="JPY":
            ans +=int(x)
        else:
            ans +=BB*float(x)

    print(ans) main def input():
    return sys.stdin.readline().rstrip() def input():
    return sys.stdin.readline().rstrip() input
import sys


def input():
    return sys.stdin.readline().rstrip()


def main():
    BB=380000
    ans =0
    N =int(input())

    for i in range(N):
        x,v =input().split()
        if v =="JPY":
            ans +=int(x)
        else:
            ans +=BB*float(x)

    print(ans)


if __name__ == "__main__":
    main()
