The report needs three struct Part records. Allocate enough room for them at run time, then fill their counts only after confirming the request succeeded.
n * sizeof *parts, check NULL before use, fill counts 1, 2, 4, print Parts: 7, and free the allocation.Read the counts for the print before calling free; after that call, the records are no longer available.
Use struct Part *parts; return on NULL before indexing.