The purpose of the present invention is to provide a novel compound having TRPA1 antagonist activity a medicine containing the compound and a pharmaceutical agent applicable to prophylaxis or treatment of diseases associated with TRPA1 antagonists and TRPA1. This compound represented by formula (I): in the formula each symbol is as defined in the description or a pharmaceutically acceptable salt thereof and a medicine or the like containing the compound or a pharmaceutically acceptable salt thereof have TRPA1 antagonist activity and are applicable to prophylaxis or treatment of diseases associated with TRPA1 antagonists and TRPA1.