#include<iostream>
#include<string>
using namespace std;

int main(){
  int N; cin>>N;
  float x[N];
  float sum=0.0;
  string u;
  for(int i=0;i<N;i++){
    cin>>x[i]>>u;
    if(u=="BTC") x[i]=x[i]*380000;
    sum += x[i];
  }
  cout<<sum;
}