public static void process ( ) throws IOException {
  int n = ni ( ) ;
  int k = ni ( ) ;
  HashMap < String , Integer > map = new HashMap < String , Integer > ( ) ;
  ArrayList < Node > list = new ArrayList < Node > ( ) ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    int a = ni ( ) ;
    int b = ni ( ) ;
    String key = Integer . toString ( a ) + "_" + Integer . toString ( b ) ;
    if ( map . isEmpty ( ) || ! map . containsKey ( key ) ) {
      map . put ( key , 1 ) ;
    }
    else {
      int current = map . get ( key ) ;
      map . put ( key , current + 1 ) ;
    }
    Node node = new Node ( a , b ) ;
    list . add ( node ) ;
  }
  Collections . sort ( list , new SortNode ( ) ) ;
  Node node = list . get ( k - 1 ) ;
  String key = Integer . toString ( node . a ) + "_" + Integer . toString ( node . b ) ;
  pn ( map . get ( key ) ) ;
  ;
}

public static void process ( ) throws IOException { int n = ni ( ) ; int k = ni ( ) ; HashMap < String , Integer > map = new HashMap < String , Integer > ( ) ; ArrayList < Node > list = new ArrayList < Node > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int a = ni ( ) ; int b = ni ( ) ; String key = Integer . toString ( a ) + " _ " + Integer . toString ( b ) ; if ( map . isEmpty ( ) || ! map . containsKey ( key ) ) { map . put ( key , 1 ) ; } else { int current = map . get ( key ) ; map . put ( key , current + 1 ) ; } Node node = new Node ( a , b ) ; list . add ( node ) ; } Collections . sort ( list , new SortNode ( ) ) ; Node node = list . get ( k - 1 ) ; String key = Integer . toString ( node . a ) + " _ " + Integer . toString ( node . b ) ; pn ( map . get ( key ) ) ; ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters) (throws (type_identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) arguments: (argument_list)))) (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: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (string_literal)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (unary_expression operand: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal))))) alternative: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (object_creation_expression type: (type_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 (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))) right: (string_literal)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier))))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))))