let nb_sub_hom2_a e s =
let n = ref 0 in
let len = Array.length s in
let i = ref 0 in
while (!i < len) do
while (!i < len) && (s.(!i) <> e) do incr i done;
while (!i < len) && (s.(!i) = e) do incr i done;
if (!i < len) then incr n
else if (s.(!i - 1) = e) then incr n
done;
!n