Statistical mechanics

Consider N identical particles in a box of volume V. The relation between their linear momentum and kinetic energy is given by [tex]E = c\left|\overrightarrow{p}\right|[/tex], where c is the speed of light. So, the Hamiltonian of the system is

[tex]H_N\left(\overrightarrow{q_1},\,\cdots,\overrightarrow{q_N},\overrightarrow{p_1},\,\cdots,\overrightarrow{p_N}\right) = c \sum_{i = 1}^N \left|p_i\right|[/tex]
Now, I'm trying to find the average energy of the system. So, I need to get Z: