How many functions $f : \{1,2,3,4,5,6\} \to \{1,2,3,4,5,6\}$ have the property that $f(f(x)) + f(x) + x$ is divisible by $3$ for all $x \in \{1,2,3,4,5,6\}$?

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