#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin >> n;
	long double ans = 0; 
	for(int i = 0; i < n; i++){
		double a;
		string s;
		cin >> a >> s;
		if(s[0] == 'J')
			ans += a;
		else
			ans += (a * 380000);
	}
	cout << ans;
}