The sums of symplectic, Hamiltonian, and skew-Hamiltonian matrices