A Hamiltonian structure with contact geometry for the semi-geostrophic equations