public static void main ( String [ ] $ ) {
  int r = scanner . nextInt ( ) , c = scanner . nextInt ( ) , k = scanner . nextInt ( ) , n = scanner . nextInt ( ) ;
  int [ ] ra = new int [ n ] , ca = new int [ n ] , rSum = new int [ r ] , cSum = new int [ c ] ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    rSum [ ra [ i ] = scanner . nextInt ( ) - 1 ] ++ ;
    cSum [ ca [ i ] = scanner . nextInt ( ) - 1 ] ++ ;
  }
  long [ ] rb = new long [ n + 1 ] , cb = new long [ n + 1 ] ;
  for ( int i : rSum ) rb [ i ] ++ ;
  for ( int i : cSum ) cb [ i ] ++ ;
  System . out . println ( java . util . stream . IntStream . rangeClosed ( 0 , k ) . mapToLong ( i -> rb [ i ] * cb [ k - i ] ) . sum ( ) + java . util . stream . IntStream . range ( 0 , n ) . map ( i -> rSum [ ra [ i ] ] + cSum [ ca [ i ] ] - k ) . map ( i -> ( i == 0 ? - 1 : i == 1 ? 1 : 0 ) ) . sum ( ) ) ;
}

public static void main ( String [ ] $ ) { int r = scanner . nextInt ( ) , c = scanner . nextInt ( ) , k = scanner . nextInt ( ) , n = scanner . nextInt ( ) ; int [ ] ra = new int [ n ] , ca = new int [ n ] , rSum = new int [ r ] , cSum = new int [ c ] ; for ( int i = 0 ; i < n ; i ++ ) { rSum [ ra [ i ] = scanner . nextInt ( ) - 1 ] ++ ; cSum [ ca [ i ] = scanner . nextInt ( ) - 1 ] ++ ; } long [ ] rb = new long [ n + 1 ] , cb = new long [ n + 1 ] ; for ( int i : rSum ) rb [ i ] ++ ; for ( int i : cSum ) cb [ i ] ++ ; System . out . println ( java . util . stream . IntStream . rangeClosed ( 0 , k ) . mapToLong ( i -> rb [ i ] * cb [ k - i ] ) . sum ( ) + java . util . stream . IntStream . range ( 0 , n ) . map ( i -> rSum [ ra [ i ] ] + cSum [ ca [ i ] ] - k ) . map ( i -> ( i == 0 ? - 1 : i == 1 ? 1 : 0 ) ) . sum ( ) ) ; }
(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 (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (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)))) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier)))) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier)))) 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 (update_expression (array_access array: (identifier) index: (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))))) (expression_statement (update_expression (array_access array: (identifier) index: (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))))))) (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 (binary_expression left: (identifier) right: (decimal_integer_literal))))) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (expression_statement (update_expression (array_access array: (identifier) index: (identifier))))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (expression_statement (update_expression (array_access array: (identifier) index: (identifier))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (method_invocation object: (method_invocation object: (field_access object: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier)) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal) (identifier))) name: (identifier) arguments: (argument_list (lambda_expression parameters: (identifier) body: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))))))) name: (identifier) arguments: (argument_list)) right: (method_invocation object: (method_invocation object: (method_invocation object: (method_invocation object: (field_access object: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier)) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal) (identifier))) name: (identifier) arguments: (argument_list (lambda_expression parameters: (identifier) body: (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (array_access array: (identifier) index: (identifier))) right: (array_access array: (identifier) index: (array_access array: (identifier) index: (identifier)))) right: (identifier))))) name: (identifier) arguments: (argument_list (lambda_expression parameters: (identifier) body: (parenthesized_expression (ternary_expression condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) consequence: (unary_expression operand: (decimal_integer_literal)) alternative: (ternary_expression condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) consequence: (decimal_integer_literal) alternative: (decimal_integer_literal))))))) name: (identifier) arguments: (argument_list))))))))