The present invention provides novel compounds having a P2X3 and/or P2X2/3 receptor antagonistic effect.A pharmaceutical composition having an analgesic effect or an improving effect of urination disorder comprising a compound of the formula (I):whereinRh and Ri are taken together to form a bond; Ra and Rb and/or Rd and Re are taken together to form oxo or the like; Rc is hydrogen, substituted or unsubstituted alkyl or the like;Rf is —(CR4aR4b)n—R2; R4a and R4b are hydrogen, substituted or unsubstituted alkyl or the like; R2 is substituted or unsubstjtuted cycloalkyl or the like; n is an integer of 1 to 4; —Rg is —X—R3; —X— is —O—, —S— or the like; R3 is substituted or unsubstituted cycloalkyl or the like,or its pharmaceutically acceptable salt or a solvate thereof.