Bounding the number of connected components of a real algebraic set