A compound represented by the formula (I): wherein each symbol is as defined in the DESCRIPTION, has a TRPA1 antagonist activity, and the compound and a medicament containing the compound are useful for the prophylaxis or treatment of diseases involving TRPA1 antagonist and TRPA1.