The speed upstream is the difference between the boat speed and the current speed. It is (12 mi)/(4 h) = 3 mph.
The speed downstream is the sum of the boat speed and the current speed. It is (32 mph)/(4 h) = 8 mph.
The speed of the boat is the average of these: (3 + 8)/2 = 5.5 mph.
The speed of the current is that less the difference: 5.5 - 3 = 2.5 mph.
_____
Check
Boat + Current = 5.5 + 2.5 = 8 mph
Boat - Current = 5.5 - 2.5 = 3 mph