#include<iostream>
using namespace std;
int main(){
	double n,a;
  	cin >> n;
   	string s;
  	double sum;
  	for(int i=0;i<n;++i){
    	cin >> a >> s;
      (s=="JPY"?sum += a:sum += a*380000);
    }
  	cout << sum << endl;
}