def METHOD_NAME(
    initial_memory: bytes,
    dest: int,
    length: int,
) -> int:
    """
    Returns the exact cost of the subcall, based on the initial memory and the length of the copy.
    """
    mcopy_cost = 3
    mcopy_cost += 3 * ((length + 31) // 32)
    if length > 0 and dest + length > len(initial_memory):
        mcopy_cost += cost_memory_bytes(dest + length, len(initial_memory))
    calldatacopy_cost = 3
    calldatacopy_cost += 3 * ((len(initial_memory) + 31) // 32)
    calldatacopy_cost += cost_memory_bytes(len(initial_memory), 0)
    pushes_cost = 3 * 7
    calldatasize_cost = 2
    return mcopy_cost + calldatacopy_cost + pushes_cost + calldatasize_cost