static int Distinct_Prime_factors ( Vector < Integer > a ) {
  HashSet < Integer > m = new HashSet < Integer > ( ) ;
  for ( int i = 0 ;
  i < a . size ( ) ;
  i ++ ) {
    int sq = ( int ) Math . sqrt ( a . get ( i ) ) ;
    for ( int j = 2 ;
    j <= sq ;
    j ++ ) {
      if ( a . get ( i ) % j == 0 ) {
        m . add ( j ) ;
        while ( a . get ( i ) % j == 0 ) {
          a . set ( i , a . get ( i ) / j ) ;
        }
      }
    }
    if ( a . get ( i ) > 1 ) {
      m . add ( a . get ( i ) ) ;
    }
  }
  return m . size ( ) ;
}

static int Distinct_Prime_factors ( Vector < Integer > a ) { HashSet < Integer > m = new HashSet < Integer > ( ) ; for ( int i = 0 ; i < a . size ( ) ; i ++ ) { int sq = ( int ) Math . sqrt ( a . get ( i ) ) ; for ( int j = 2 ; j <= sq ; j ++ ) { if ( a . get ( i ) % j == 0 ) { m . add ( j ) ; while ( a . get ( i ) % j == 0 ) { a . set ( i , a . get ( i ) / j ) ; } } } if ( a . get ( i ) > 1 ) { m . add ( a . get ( i ) ) ; } } return m . size ( ) ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (generic_type (type_identifier) (type_arguments (type_identifier))) name: (identifier))) body: (block (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier))) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (identifier)) right: (decimal_integer_literal))) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (identifier))))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))))) (return_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))