#include <iostream>
#include <string>
using namespace std;
int main()
{
	int n;
	double x,t=0.0;
	string s;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> x >> s;
		if (s == "JPY")t += x;
		else t +=(380000 * x);
	}
	cout << t << "\n";
	return 0;
}