import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    xu = [list(input().split()) for _ in range(n)]
    ans = 0
    for i in range(n):
        if xu[i][1] == "JPY":
            ans += int(xu[i][0])
        else:
            ans += (float(xu[i][0]) * 380000)
    print(ans)
        
if __name__ == '__main__':
    main() import sys sys input = lambda: sys.stdin.readline().rstrip() input lambda: 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():
    n = int(input())
    xu = [list(input().split()) for _ in range(n)]
    ans = 0
    for i in range(n):
        if xu[i][1] == "JPY":
            ans += int(xu[i][0])
        else:
            ans += (float(xu[i][0]) * 380000)
    print(ans)
         main n = int(input()) n int(input()) int input() input list(input().split()) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(input().split()) list input().split() ().split () input split xu = [list(input().split()) for _ in range(n)] xu [list(input().split()) for _ in range(n)] ans = 0 ans 0 for i in range(n):
        if xu[i][1] == "JPY":
            ans += int(xu[i][0])
        else:
            ans += (float(xu[i][0]) * 380000)
     i range(n) range n if xu[i][1] == "JPY":
            ans += int(xu[i][0])
        else:
            ans += (float(xu[i][0]) * 380000)
     xu[i][1] == "JPY" xu[i][1] [i] xu i 1 "JPY" ans += int(xu[i][0]) ans int(xu[i][0]) int xu[i][0] [i] xu i 0 ans += (float(xu[i][0]) * 380000) ans float(xu[i][0]) * 380000 float(xu[i][0]) float xu[i][0] [i] xu i 0 380000 print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n = int(input())
    xu = [list(input().split()) for _ in range(n)]
    ans = 0
    for i in range(n):
        if xu[i][1] == "JPY":
            ans += int(xu[i][0])
        else:
            ans += (float(xu[i][0]) * 380000)
    print(ans)
         def main():
    n = int(input())
    xu = [list(input().split()) for _ in range(n)]
    ans = 0
    for i in range(n):
        if xu[i][1] == "JPY":
            ans += int(xu[i][0])
        else:
            ans += (float(xu[i][0]) * 380000)
    print(ans)
         main input = lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() input
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    xu = [list(input().split()) for _ in range(n)]
    ans = 0
    for i in range(n):
        if xu[i][1] == "JPY":
            ans += int(xu[i][0])
        else:
            ans += (float(xu[i][0]) * 380000)
    print(ans)
        
if __name__ == '__main__':
    main()