| ?- occurences(spam, [oh, spam, spam, we, love, spam], X).
X = 3 ;
no
When writing this function, be careful that it "computes" exactly the
correct number of occurences (an easy pitfall is to
write a version of this function that returns all values of X
less than or equal to the number of occurences).