occ(_,[],0).
occ(A,[A|T],N):- occ(A,T,N1),N is N1+1, !.
occ(A,[_|T],N):- occ(A,T,N).
