

'''simple docstring'''

from __future__ import annotations

from typing import Any





def 				A_					(	*snake_case	):



  if all(_check_not_integer(snake_case	) for m in matrix_s	):
    for i in matrix_s[1:]:
      _verify_matrix_sizes(matrix_s[0] ,    snake_case	)
    return [[sum(snake_case	) for t in zip(*snake_case	)] for m in zip(*snake_case	)]
  raise TypeError("Expected a matrix, got int/list instead"	)





def 				A_					(	snake_case ,    snake_case	):



  if (
      _check_not_integer(snake_case	)
      and _check_not_integer(snake_case	)
      and _verify_matrix_sizes(snake_case ,    snake_case	)
  ):
    return [[i - j for i, j in zip(*snake_case	)] for m in zip(snake_case ,    snake_case	)]
  raise TypeError("Expected a matrix, got int/list instead"	)





def 				A_					(	snake_case ,    snake_case	):
  return [[x * n for x in row] for row in matrix]





def 				A_					(	snake_case ,    snake_case	):



  if _check_not_integer(snake_case	) and _check_not_integer(snake_case	):
    SCREAMING_SNAKE_CASE ,      SCREAMING_SNAKE_CASE:List[Any]   =   _verify_matrix_sizes(snake_case ,    snake_case	)

  if cols[0] != rows[1]:
    SCREAMING_SNAKE_CASE:str   =   (
        "Cannot multiply matrix of dimensions "
        F'''({rows[0]},{cols[0]}) and ({rows[1]},{cols[1]})'''
    )
    raise ValueError(snake_case	)
  return [
      [sum(m * n for m, n in zip(snake_case ,    snake_case	)	) for j in zip(*snake_case	)] for i in matrix_a
  ]





def 				A_					(	snake_case	):
  SCREAMING_SNAKE_CASE:Union[str, Any]   =   int(snake_case	)
  return [[int(row == column	) for column in range(snake_case	)] for row in range(snake_case	)]





def 				A_					(	snake_case ,    snake_case = True	):



  if _check_not_integer(snake_case	):
    if return_map:
      return map(snake_case ,    zip(*snake_case	)	)
    else:
      return list(map(snake_case ,    zip(*snake_case	)	)	)
  raise TypeError("Expected a matrix, got int/list instead"	)





def 				A_					(	snake_case ,    snake_case ,    snake_case	):
  SCREAMING_SNAKE_CASE:str   =   matrix[:row] + matrix[row + 1 :]
  return [row[:column] + row[column + 1 :] for row in minor]





def 				A_					(	snake_case	):



  if len(snake_case	) == 1:
    return matrix[0][0]

  return sum(
      x * determinant(minor(snake_case ,    0 ,    snake_case	)	) * (-1) ** i
      for i, x in enumerate(matrix[0]	)	)





def 				A_					(	snake_case	):
  SCREAMING_SNAKE_CASE:str   =   determinant(snake_case	)
  if det == 0:
    return None

  SCREAMING_SNAKE_CASE:Any   =   [
      [determinant(minor(snake_case ,    snake_case ,    snake_case	)	) for j in range(len(snake_case	)	)]
      for i in range(len(snake_case	)	)
  ]

  SCREAMING_SNAKE_CASE:List[Any]   =   [
      [x * (-1) ** (row + col) for col, x in enumerate(matrix_minor[row]	)]
      for row in range(len(snake_case	)	)
  ]
  SCREAMING_SNAKE_CASE:Dict   =   list(transpose(snake_case	)	)
  return scalar_multiply(snake_case ,    1 / det	)





def 				A_					(	snake_case	):
  return not isinstance(snake_case ,    snake_case	) and not isinstance(matrix[0] ,    snake_case	)





def 				A_					(	snake_case	):
  return len(snake_case	), len(matrix[0]	)





def 				A_					(	snake_case ,    snake_case	):
  SCREAMING_SNAKE_CASE:Union[str, Any]   =   _shape(snake_case	) + _shape(snake_case	)
  if shape[0] != shape[3] or shape[1] != shape[2]:
    SCREAMING_SNAKE_CASE:List[Any]   =   (
        "operands could not be broadcast together with shape "
        F'''({shape[0], shape[1]}), ({shape[2], shape[3]})'''
    )
    raise ValueError(snake_case	)
  return (shape[0], shape[2]), (shape[1], shape[3])





def 				A_					(	):
  SCREAMING_SNAKE_CASE:Union[str, Any]   =   [[12, 10], [3, 9]]
  SCREAMING_SNAKE_CASE:Dict   =   [[3, 4], [7, 4]]
  SCREAMING_SNAKE_CASE:str   =   [[11, 12, 13, 14], [21, 22, 23, 24], [31, 32, 33, 34], [41, 42, 43, 44]]
  SCREAMING_SNAKE_CASE:Dict   =   [[3, 0, 2], [2, 0, -2], [0, 1, 1]]
  print(F'''Add Operation, {add(snake_case ,    snake_case	) = } \n'''	)
  print(
      F'''Multiply Operation, {multiply(snake_case ,    snake_case	) = } \n''' ,    )
  print(F'''Identity: {identity(5	)}\n'''	)
  print(F'''Minor of {matrix_c} = {minor(snake_case ,    1 ,    2	)} \n'''	)
  print(F'''Determinant of {matrix_b} = {determinant(snake_case	)} \n'''	)
  print(F'''Inverse of {matrix_d} = {inverse(snake_case	)}\n'''	)


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    main()









'''simple docstring'''

from collections import Counter





def 				A_					(	snake_case	):
  return sum(socks_by_color // 2 for socks_by_color in Counter(snake_case	).values()	)


if __name__ == "__main__":
    import doctest

    doctest.testmod()

    A_      =							[int(x) for x in input("Enter socks by color :").rstrip().split()]
    print(f'''sock_merchant({colors}) = {sock_merchant(colors)}''')






