Compute the number of triples $(f,g,h)$ of permutations on $\{1,2,3,4,5\}$ such that \begin{align*} 
 & f(g(h(x))) = h(g(f(x))) = g(x)  \\
 & g(h(f(x))) = f(h(g(x))) = h(x), \text{ and }  \\
 & h(f(g(x))) = g(f(h(x))) = f(x),  \\
\end{align*}  for all $x\in \{1,2,3,4,5\}$. 

Let's think step by step and output the final answer within \boxed{}.
user