A compound represented by formula (I) and having a property of modulating the activity of an androgen receptor, or a pharmaceutically acceptable salt of the compound. X represents S or O; Z represents (Ra)n-A-(CR13R14)0-1-(CR11R12)0-1-; A represents an aryl group or a heteroaryl group; R1 represents an alkyl group, a cycloalkyl group, an alkenyl group, an alkynyl group, an alkoxyalkyl group, an aryl group, an arylalkyl group, a heterocyclic group or a heterocyclic alkyl group; R2 represents a hydrogen atom, a halogen atom, an alkyl group, a cycloalkyl group or a phenyl group; R3 represents a hydrogen atom, a halogen atom, an alkyl group, a cycloalkyl group, an alkoxyalkyl group, an alkenyl group, an alkynyl group, a cycloalkenyl group, an aryl group, an arylalkyl group, a heterocyclic group, a heterocyclic alkyl group, an acyl group, a cycloalkylcarbonyl group, a benzoyl group, a spiroalkyl group, an adamantyl group, a silyl group or R31R32NCO-; and R4 and R5 independently represent a hydrogen atom, a halogen atom, an alkyl group, a phenyl group or a cycloalkyl group.