#include <iostream>
#include <string>

using namespace std;

int main() {
	int n; cin >> n;
	long double x, ans = 0;
	string u;
	while (n--) {
		cin >> x >> u;
		if (u == "JPY") ans += x;
		else ans += x * 380000.0;
	}
	printf("%.6Lf\n",ans);
}