Sayali,
You can modify Jan's code like this by adding an OR clause
{%Documents.ClassNames("cms.news").WithAllData.Where("pinned=1").Count<3 || CMSContext.Current.CurrentDocument.pinned ==1 |(identity)GlobalAdministrator%}
So this will check for whether no of documents < 3 or if document is already checked.
Try and let us know.