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

int main(){
  int n;
  cin >> n;

  double ret = 0;
  for(int i = 0;i < n;i++){
    double x;
    string u;
    cin >> x >> u;

    if(u == "BTC")x *= 380000;

    ret += x;
  }

  cout << ret << endl;
}
