[Problem] To provide a compound of formula (I) that is useful as a dopamine D1 receptor positive allosteric modulator (D1 PAM). [Solution] The inventors studied a compound that has a dopamine D1 receptor positive allosteric modulating action and is useful as an active ingredient for a pharmaceutical composition for preventing and/or treating cognitive dysfunction, negative symptoms of schizophrenia, Parkinsons disease, Alzheimers disease, Huntingtons disease, drug dependence, etc., have verified that a heterocyclic acetic acid amide compound has a dopamine D1 receptor positive allosteric modulating action, and have completed the present invention. This heterocyclic acetic acid amide compound has a dopamine D1 receptor positive allosteric modulating action and may be used as a preventive and/or therapeutic agent for cognitive dysfunction, negative symptoms of schizophrenia, Parkinsons disease, Alzheimers disease, Huntingtons disease, drug dependence, etc.