def sumofFactors(n):
    total = 0
    for factor in range(2, n + 1, 2):
        if n % factor == 0:
            total += factor
    return total