static int countPoints ( int n , point points [ ] ) {
  int [ ] minx = new int [ MX ] ;
  int [ ] miny = new int [ MX ] ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    minx [ i ] = Integer . MAX_VALUE ;
    miny [ i ] = Integer . MAX_VALUE ;
  }
  int [ ] maxx = new int [ MX ] ;
  int [ ] maxy = new int [ MX ] ;
  int x , y ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    points [ i ] . x += OFF ;
    points [ i ] . y += OFF ;
    x = points [ i ] . x ;
    y = points [ i ] . y ;
    minx [ y ] = Math . min ( minx [ y ] , x ) ;
    maxx [ y ] = Math . max ( maxx [ y ] , x ) ;
    miny [ x ] = Math . min ( miny [ x ] , y ) ;
    maxy [ x ] = Math . max ( maxy [ x ] , y ) ;
  }
  int count = 0 ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    x = points [ i ] . x ;
    y = points [ i ] . y ;
    if ( x > minx [ y ] && x < maxx [ y ] ) if ( y > miny [ x ] && y < maxy [ x ] ) count ++ ;
  }
  return count ;
}

static int countPoints ( int n , point points [ ] ) { int [ ] minx = new int [ MX ] ; int [ ] miny = new int [ MX ] ; for ( int i = 0 ; i < n ; i ++ ) { minx [ i ] = Integer . MAX_VALUE ; miny [ i ] = Integer . MAX_VALUE ; } int [ ] maxx = new int [ MX ] ; int [ ] maxy = new int [ MX ] ; int x , y ; for ( int i = 0 ; i < n ; i ++ ) { points [ i ] . x += OFF ; points [ i ] . y += OFF ; x = points [ i ] . x ; y = points [ i ] . y ; minx [ y ] = Math . min ( minx [ y ] , x ) ; maxx [ y ] = Math . max ( maxx [ y ] , x ) ; miny [ x ] = Math . min ( miny [ x ] , y ) ; maxy [ x ] = Math . max ( maxy [ x ] , y ) ; } int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { x = points [ i ] . x ; y = points [ i ] . y ; if ( x > minx [ y ] && x < maxx [ y ] ) if ( y > miny [ x ] && y < maxy [ x ] ) count ++ ; } return count ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (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 (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (field_access object: (identifier) field: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (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 (expression_statement (assignment_expression left: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (identifier))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (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 (expression_statement (assignment_expression left: (identifier) right: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))) right: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))) consequence: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))) right: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))) consequence: (expression_statement (update_expression (identifier))))))) (return_statement (identifier))))