At a given price, if the point at which quantity demanded is greater than the quantity supplied there will be a shortage. You will then have to subtract quantity supplied from quantity demanded. Visaully, the point of quantity supplied will come first, then the equilibrum in the middle, and then quantity demanded