import math


def calc_sum_d_squared(bolts):
    """Return the sum of the squared bolt distances."""
    sum_d_squared = 0.0
    for bolt in bolts:
        d = bolt[7]
        sum_d_squared = sum_d_squared + math.pow(d, 2)

    return sum_d_squared