Determination of the surface structure of layered compounds by low-energy electron diffraction