def hept_pyramid(s: int, n: int) -> int:
    """Make a pyramid with a polygonal shaped base.

    Args:
        s: polygonal shape
        n: height/side length of the pyramid

    Returns:
        int: number of canon balls needed to make the pyramid
    """
    pyramid = (3 * n ** 2 + n ** 3 * (s - 2) - n * (s - 5)) / 6
    return int(pyramid)