Nifty hits 5-month high at 23,774; Apollo Hospitals gains 0.54%