from itertools import combinations


def calculate_area(length, width, height):
    """Calculate the area of wrapping paper required"""

    # Calculate area of package one side at a time
    # Uses itertools.combinations to create combinations of two
    # sides from length, width and height.
    # List comprehension is used to calculate area from the combination
    # by multiplying the two sides in the combination.
    package_side_areas = [
        x * y
        for x, y in
        combinations((length, width, height), 2)]

    # Package size is twice the sum of areas
    # (each side is present twice on the opposite sides of the package)
    package_area = 2 * sum(package_side_areas)

    # Slack is the area with the smallest side.
    package_area += min(package_side_areas)

    return package_area