Controlling chaos by the system size