#include <iostream>                                                                                                                               
#include <map>                                                                                                                                    
#include <vector>                                                                                                                                 
using namespace std;                                                                                                                              
                                                                                                                                                  
int main() {                                                                                                                                      
    int n;                                                                                                                                        
    cin >> n;                                                                                                                                     
                                                                                                                                                  
    double x;                                                                                                                                     
    string u;                                                                                                                                     
                                                                                                                                                  
    double ans = 0;                                                                                                                               
    for(int i = 0; i < n; i++) {                                                                                                                  
        cin >> x >> u;                                                                                                                            
        if (u == "JPY") {                                                                                                                         
            ans += x;                                                                                                                             
        } else {                                                                                                                                  
            ans += 380000.0 * x;                                                                                                                  
        }                                                                                                                                         
    }                                                                                                                                             
    cout << ans << endl;                                                                                                                          
} 

Measured memory_bytes: 256