let rec nb_sub_hom1 e s =
  match s with
      [] -> 0
    | [e1] -> if (e = e1) then 1 else 0
    | e1::e2::s' ->
        if (e1 = e) then
          if (e2 = e) then (nb_sub_hom1 e (e2::s'))
          else 1 + (nb_sub_hom1 e (e2::s'))
        else (nb_sub_hom1 e (e2::s'))