#include <bits/stdc++.h>
#include <string>
using namespace std;

int main() {
  int N;
  cin >> N;
      
  double sum;
  
  for (int i = 0; i < N; ++i) {
  	double x;
    string u;
    cin >> x >> u;
    
    if (u == "BTC") {
      x *= 380000.0;
    }
    
    sum += x; 
  }

  cout << sum << endl;
}