from functools import reduce


def sock_merchant(socks_amount: int, socks: list) -> int:
    """
    Get a list of socks and then classify them into their colors pair
    :param socks_amount: The total number of socks
    :param socks: The socks for each pair
    :return: The maximum pairs per color possible
    """
    unique_socks = list(set(socks))
    total_amount = reduce(
        lambda pairs, sock: pairs + (socks.count(sock) // 2),
        unique_socks, 0
    )

    return total_amount