#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n, i;
	cin >> n;
	double t=0;
	for (i=1; i<=n; i++)
	{
		double a1;
		string a2;
		cin >> a1 >> a2;
		if (a2=="JPY") t+=a1;
		if (a2=="BTC") t+=(a1*380000);
	}
	cout << t << endl;
	return 0;
}