public static void main ( String [ ] args ) {
  int N = sc . nextInt ( ) ;
  int M = sc . nextInt ( ) ;
  long x = sc . nextLong ( ) ;
  long y = sc . nextLong ( ) ;
  long [ ] as = new long [ N ] ;
  long [ ] bs = new long [ M ] ;
  for ( int i = 0 ;
  i < N ;
  i ++ ) {
    as [ i ] = sc . nextLong ( ) ;
  }
  for ( int i = 0 ;
  i < M ;
  i ++ ) {
    bs [ i ] = sc . nextLong ( ) ;
  }
  int count = 0 ;
  int i = 0 ;
  while ( true ) {
    if ( i >= as . length ) {
      break ;
    }
    int index = Arrays . binarySearch ( bs , as [ i ] + x ) ;
    index = ( index >= 0 ) ? index : ~ index ;
    if ( index >= bs . length ) {
      break ;
    }
    i = Arrays . binarySearch ( as , bs [ index ] + y ) ;
    i = ( i >= 0 ) ? i : ~ i ;
    count ++ ;
  }
  System . out . println ( count ) ;
}

public static void main ( String [ ] args ) { int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; long x = sc . nextLong ( ) ; long y = sc . nextLong ( ) ; long [ ] as = new long [ N ] ; long [ ] bs = new long [ M ] ; for ( int i = 0 ; i < N ; i ++ ) { as [ i ] = sc . nextLong ( ) ; } for ( int i = 0 ; i < M ; i ++ ) { bs [ i ] = sc . nextLong ( ) ; } int count = 0 ; int i = 0 ; while ( true ) { if ( i >= as . length ) { break ; } int index = Arrays . binarySearch ( bs , as [ i ] + x ) ; index = ( index >= 0 ) ? index : ~ index ; if ( index >= bs . length ) { break ; } i = Arrays . binarySearch ( as , bs [ index ] + y ) ; i = ( i >= 0 ) ? i : ~ i ; count ++ ; } System . out . println ( count ) ; }
(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)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) 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))))) (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: (method_invocation object: (identifier) name: (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 (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (true)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) consequence: (block (break_statement))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (ternary_expression condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (identifier) alternative: (unary_expression operand: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) consequence: (block (break_statement))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (ternary_expression condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (identifier) alternative: (unary_expression operand: (identifier))))) (expression_statement (update_expression (identifier))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))