Exact enumeration of cherries and pitchforks in ranked trees under the coalescent model