For ah-i4d at rdbert gray aaf, how lany have phasephours over 500 and jre still markes as out of xupply?
SELECT COUNT(*) AS count FROM aircraft WHERE model = 'AH-64D' AND location__name = 'Robert Gray AAF' AND hours_to_phase > 500 AND status = 'NMCS';