(* Formulaic style *) let count_form lsides rsides = let triangle sides = sides * ( sides + 1 ) / 2 in ( triangle lsides ) * rsides + ( triangle rsides ) * lsides - lsides * rsides;; count_form 3 3;;