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

int main() {
  int N;
  cin >> N;
  double ans = 0;
  for (int i = 0; i < N; i++) {
  	double d;
    string s;
    cin >> d >> s;
    ans += (s == "BTC" ? d * 380000.0 : d);
  }
  cout << ans << endl;
}
