According to the static trade-off theory of capital structure, how does a firm determine its optimal level of debt?