<s>[INST] def nested_list_sum(nested_list):
    total = 0
    for element in nested_list:
        if isinstance(element, list):
            total += nested_list_sum(element)
        else:
            total += element
    return total[/INST]