Although it is strongly advised to stay away from merged cells when performing formula-based calculations. It creates far too many issues. You can still use some strategies to succeed. You might try the formula below for your situation:
=COUNTIFS(INDIRECT("C"&MATCH($F2,$A:$A,0)&":C"&MATCH($F2,$A:$A,0)+5),G$1)