2018 AIME II Problem 10

Find the number of functions f(x) from \{1,2,3,4,5\} to \{1,2,3,4,5\} that satisfy f(f(x))=f(f(f(x))) for all x in \{1,2,3,4,5\}.