def dns_label_count(rows, args):
    """Returns the number of labels in a given domain (eg: www.example.com = 3)"""
    label = rows[args[0]]
    parts = label.split(".")
    # deal with www.exmaple.com. with a trailing dot
    if parts[-1] == "":
        return (str(len(parts)-1),'')
    return (str(len(parts)),'')