Short-term losses must first be applied to short-term gains. Then, the remaining short-term losses can be used to offset long-term gains.