#include <bits/stdc++.h>
using namespace std;
signed main()
{
	int n;
	cin>>n;
	double ans=0;
	for(int i=0;i<n;i++)
	{
		string str;
		double val;
		cin>>val>>str;
		if(str=="BTC")val*=380000;
		ans+=val;
	}
	cout<<ans<<endl;
	return 0;
} 