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

int main()
{
  int n;
  cin>>n;
  double x,s=0;
  string y;
  for (int i=1;i<=n;i++)
  {
    cin>>x>>y;
    if (y=="JPY")
      s+=x;
    else
      s+=x*380000.0;
  }
  cout<<s;
}
