def total_distance(positons:list, loc:int) -> int:
    """Calculate the total distance to all line up at loc"""
    return sum([
        abs(x) for x in [
            i - loc for i in positons
        ]
    ])