let nb_sub_hom1_e e s =
let n = ref 0 in
let was_e = ref false in
let rec loop s =
match s with
[] -> if !was_e then incr n
| e'::s' -> (
if (e' = e) <> !was_e then (
if !was_e then incr n;
was_e := not !was_e
);
(loop s')
)
in
(loop s);
!n