I'd say you need a 5/6 rank deep phalanx unit to stop a cavalry unit from the front. 3 is definitly not enough.

Louis,