N = int(input())
Price = 0
Rate  = 380000
for T in range(0,N):
    X,U = input().split()
    if U=='JPY': Price += int(X)
    else: Price += float(X)*Rate
print(Price) N = int(input()) N int(input()) int input() input Price = 0 Price 0 Rate  = 380000 Rate 380000 for T in range(0,N):
    X,U = input().split()
    if U=='JPY': Price += int(X)
    else: Price += float(X)*Rate T range(0,N) range 0 N X,U = input().split() X input().split() ().split () input split U if U=='JPY': Price += int(X)
    else: Price += float(X)*Rate U=='JPY' U 'JPY' print(Price) print Price N = int(input()) int(input()) N U = input().split() input().split() U Rate  = 380000 380000 Rate Price = 0 0 Price X,U = input().split() input().split() X
N = int(input())
Price = 0
Rate  = 380000
for T in range(0,N):
    X,U = input().split()
    if U=='JPY': Price += int(X)
    else: Price += float(X)*Rate
print(Price)