Measure of tripartite entanglement in bosonic and fermionic systems