def get_cidr(mask):
    """
    Takes a given subnet mask and converts it to CIDR notation
    :param mask: (str) The subnet mask to convert
    :return: (int): The CIDR value
    """
    # Converts each block of the given mask into its binary version, and counts the 1s
    return sum(bin(int(x)).count('1') for x in mask.split('.'))