#include <bits/stdc++.h>
int main() {
  int N;
  double x;
  std::string u;
  double r{};
  std::cin >> N;
  for (int i = 0; i < N; ++i) {
    std::cin >> x >> u;
    if (u == "BTC")
      r += x * 380000.0;
    else
      r += x;
  }
  std::cout << r << std::endl;
}
