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