On integrable cases of the poincare problem