#include <bits/stdc++.h>
using namespace std;

int main (void){
	char u[5];
	double x,n;
	int i;
	double ans=0;
	cin >> n;
	for(i=1;i<=n;i++){
		cin >> x >> u;
		if(u[0]=='J') ans+=x;
		else ans+=x*380000.0;
	}
	cout << ans << endl;
}