import math


def hosts_from_prefixlength(prefixlength):
    """Calculate the number of hosts supported ia given prefix length.

    Args:
        prefixlength (int): CIDR mask to find the number of supported hosts.

    Returns:
        hosts (int):  The number of hosts in a subnet the size of a given prefix length (minus net and bcast).
    """
    hosts = math.pow(2, 32 - prefixlength) - 2
    return int(hosts)