Let $S$ be a set of $a+b+3$ points on a sphere, where $a$, $b$ are nonnegative integers and no four points of $S$ are coplanar. Determine how many planes pass through three points of $S$ and separate the remaining points into $a$ points on one side of the plane and $b$ points on the other side.
1. **Initial Setup and Inversion:**
   - Let \( S \) be a set of \( a + b + 3 \) points on a sphere, where \( a \) and \( b \) are nonnegative integers, and no four points of \( S \) are coplanar.
   - Select an arbitrary point \( P \) on the sphere that does not lie on any plane passing through three points of \( S \).
   - Apply an inversion about \( P \). After inversion, the points of \( S \) lie on a plane \( \Pi \), and the problem reduces to counting circles on \( \Pi \) passing through three points of \( S \) that contain exactly \( a \) or \( b \) points inside.

2. **Reduction to Plane Geometry:**
   - We need to count the number of circles passing through three points of \( S \) that contain exactly \( a \) or \( b \) points inside.
   - Define \( g_S(a, b) \) as the number of such circles for a set \( S \) of \( a + b + 3 \) points in general position.

3. **General Position and Convex Sets:**
   - For a set \( S \) of \( n \) points in general position, let \( f_S(a) \) denote the number of circles passing through three points of \( S \) and containing exactly \( a \) points inside.
   - Claim: For any \( a \leq n - 3 \), \( f_S(a) \) is fixed for all sets of \( n \) points in general position forming the vertices of a convex \( n \)-gon.

4. **Proof of Claim:**
   - Consider two convex sets \( S_1 \) and \( S_2 \) of \( n \) points in general position with \( n - 1 \) points in common.
   - Let \( P \) be the point in \( S_1 \) not in \( S_2 \), and \( Q \) be the point in \( S_2 \) not in \( S_1 \).
   - Move \( P \) to \( Q \) along a path such that no three points become collinear and no four points become cyclic.
   - As \( P \) moves, the number of circles passing through three points of \( S_1 \) with exactly \( a \) points inside remains unchanged.
   - Thus, \( f_{S_1}(a) = f_{S_2}(a) \).

5. **Lemma 1:**
   - Over all sets \( S \) with \( a + b + 3 \) points in general position, \( g_S(a, b) \) is constant.
   - Proof is similar to the claim, allowing points to cross lines.

6. **Computation for Convex Sets:**
   - For any convex set \( S \) of \( a + b + 3 \) points, \( g_S(a, b) = f_S(a + b + 3, a) + f_S(a + b + 3, b) \) if \( a \neq b \), and \( g_S(a, b) = f_S(a + b + 3, a) \) if \( a = b \).

7. **Lemma 2:**
   - \( f(a + b + 3, b) = (a + 1)(b + 1) \) for all \( a, b \in \mathbb{N} \).
   - Proof by induction on \( b \):
     - Base case \( b = 0 \): \( f(a + 3, 0) = a + 1 \).
     - Inductive step: Assume \( f(a + k + 3, k) = (a + 1)(k + 1) \). For \( b = k + 1 \), \( f(a + k + 4, k + 1) = f(a + k + 3, k) + a + 1 = (a + 1)(k + 2) \).

8. **Conclusion:**
   - From Lemma 2, the result follows: \( g_S(a, b) = 2(a + 1)(b + 1) \) if \( a \neq b \), and \( g_S(a, b) = (a + 1)(b + 1) \) if \( a = b \).

The final answer is \( \boxed{ 2(a + 1)(b + 1) } \) if \( a \neq b \) and \( (a + 1)(b + 1) \) if \( a = b \).