Use conservation of energy: Calculate the total potential energy (related to water surface) for upper half of water ! U= \int dm \cdot g \cdot y =\int \rho \cdot  dV \cdot g \cdot y =\int \rho \cdot   A \cdot  dy \cdot  g \cdot  y where \rho is the density, A is the area