The present invention provides novel compounds having a P2X 3 and/or P2X 2 / 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): wherein R h and R j are taken together to form a bond; R a and R b and/or R d and R e are taken together to form oxo or the like; R c is hydrogen, substituted or unsubstituted alkyl or the like; R f is -(CR 4a R 4b )n-R 2 ; R 4a and R 4b are hydrogen, substituted or unsubstituted alkyl or the like; R 2 is substituted or unsubstituted cycloalkyl or the like; n is an integer of 1 to 4; -R g is -X-R 3 ; -X- is -O-, -S- or the like; R 3 is substituted or unsubstituted cycloalkyl or the like, or its pharmaceutically acceptable salt or a solvate thereof.