A hybrid approach for solving the gravitational N-body problem with Artificial Neural Networks