Brief layout of strategy: 1. Write down Lorentz force ${\bf F}$. 2. Find (velocity-dependent) potential $U$ for ${\bf F}$. 3. Write down Lagrangian $L$. 4. Perform Legendre transformation ${\bf v}\to {\bf p}$. 5. Write down Hamiltonian $H$.