public static void main ( String [ ] args ) {
  try ( Scanner scanner = new Scanner ( System . in ) ) {
    int count = scanner . nextInt ( ) ;
    scanner . nextLine ( ) ;
    BigDecimal rate = new BigDecimal ( "380000.0" ) ;
    System . out . println ( IntStream . range ( 0 , count ) . mapToObj ( i -> {
      String amount = scanner . next ( ) ;
      String currency = scanner . next ( ) ;
      scanner . nextLine ( ) ;
      if ( "JPY" . equals ( currency ) ) {
        return new BigDecimal ( amount ) ;
      }
      else {
        return ( new BigDecimal ( amount ) ) . multiply ( rate ) ;
      }
    }
    ) . reduce ( BigDecimal . ZERO , BigDecimal :: add ) ) ;
  }
}

public static void main ( String [ ] args ) { try ( Scanner scanner = new Scanner ( System . in ) ) { int count = scanner . nextInt ( ) ; scanner . nextLine ( ) ; BigDecimal rate = new BigDecimal ( "380000.0" ) ; System . out . println ( IntStream . range ( 0 , count ) . mapToObj ( i -> { String amount = scanner . next ( ) ; String currency = scanner . next ( ) ; scanner . nextLine ( ) ; if ( " JPY " . equals ( currency ) ) { return new BigDecimal ( amount ) ; } else { return ( new BigDecimal ( amount ) ) . multiply ( rate ) ; } } ) . reduce ( BigDecimal . ZERO , BigDecimal :: add ) ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (try_with_resources_statement resources: (resource_specification (resource type: (type_identifier) name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (string_literal))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (identifier))) name: (identifier) arguments: (argument_list (lambda_expression parameters: (identifier) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (if_statement condition: (parenthesized_expression (method_invocation object: (string_literal) name: (identifier) arguments: (argument_list (identifier)))) consequence: (block (return_statement (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier))))) alternative: (block (return_statement (method_invocation object: (parenthesized_expression (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier)))) name: (identifier) arguments: (argument_list (identifier)))))))))) name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)) (method_reference (identifier) (identifier)))))))))))