#include<iostream>
using namespace std;
double ans=0;
int main(){
	double x;
	string s;
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>x;
		cin>>s;
		if(s[0]=='J')
		ans+=x;
		else ans+=380000*x;
	}
	cout<<ans;
	return 0;
}