Extremal graphs for the odd prism