#include <cstdio>

int main() {
  int N;
  scanf("%d", &N);

  double res = 0;
  for (int i = 0; i < N; ++i) {
    double u;
    char x[4];
    scanf("%lf %s", &u, x);

    if (*x == 'B') u *= 380000;
    res += u;
  }
  printf("%.12e\n", res);
}
