The present invention provide a medicament for treating the diseases induced by production, secretion or deposition of amyloid-β proteins, for example, a compound of the following formula (I) wherein R1, R2a, R2b, R3, R4, R5, X, L1, L2, ring A, ring B and the dotted line are defined in the specification, its pharmaceutically acceptable salt or a solvate thereof.