Hi , as you have mentioned that you have three times pneumonia
i think your complains are related to the complications of pneumonia!! which includes pleurisy and lung abscess
.. As in your case it might be both , sharp pain
might due to pleurisy which is inflammation of the pleura, the two thin linings between your lungs and your ribcage . Even Pleural effusion
might be the cause.. kindly consult your doc regarding both the conditions pleurisy and abscess ...