The unified power flow controllers(UPFCs) are installed in order to improve reliability of composite generation and transmission systems. The power injection model of a UPFC is embedded into the traditional optimal load shedding model. Using the physical meaning of Lagrange multipliers of UPFCs control parameters in the inequality constraints of UPFC, a mathematical model for the first order sensitivity of expected energy not supplied(EENS) with respect to the capacity of UPFC is derived. Furthermore, a method based on the ranking of the sensitivity indices to determine the optimal installation site of UPFCs is proposed. Finally, the total cost including investment cost and customer interruption cost is calculated to identify the optimal capacity of UPFC. Simulation results of RBTS and IEEE-RTS79 system show validity and effectiveness of the proposed optimal allocation method.