def n50(values):
    """Return the N50 of the list of numbers"""
    values.sort(reverse=True)
    target = sum(values) / 2.
    total = 0
    for v in values:
        total += v
        if total >= target:
            return v
    return 0