How many factories did the company lose by 1647?