There are an infinite number of sea quarks in any hadron, it is important to remember that these sea quarks are "off shell" particles as such, they are temporary particles, that do not exist before or after the interaction in the final or initial state, they are particle-antiparticle pairs created as part of the energy in the interaction, they do not effect the interaction in the same way that the valence quarks do, in that they have no impact on anything outside the hadron. Think of them as energy in the system manifesting as unstable particles for limited amounts of time before returning to energy again, for a majority of the time they do not exist, but their potential for existence must be accounted for (this isn't the best way to approach thinking about QFT, which should be dealt with exclusively mathematically, otherwise we will be wrong in some way, or our heads will explode).
In QFT, we use Feynman diagrams to represent an interaction, but there are many ways to represent the same interaction (same initial and final states), it can be shown that in order to get the correct measurements for any aspect of an interaction, we must add together contributions from all possible Feynman diagrams for that interaction (I won't explain this here, my answer is long enough as it is).
If you're familiar with Feynman diagrams, these are the particle represented as being "inside" the diagram, the intermediate steps between the initial and final states. An important feature of Feynman diagrams is that this intermediate step of off shell particles can be infinite in complexity and still preserve the interaction, i.e. there can be an infinite number of these off shell particles.
We then organize these Feynman diagrams into a hierarchy. The simple "tree level" diagrams, which represent the interaction with only one off-shell intermediate state are first, then comes the "one-loop" diagrams where a "loop" pair of creating and annihilating particles is formed as part of the intermediate state. Here's a few diagrams I found illustrating this:
Tree level QED processes:

One loop diagram of the same interaction:

This hierarchy continues with two loops, three, etc to infinity.
It is these loops of created an annihilated pairs that are our sea quarks (in QCD only obviously). Since the hierarchy continues to a infinite number of loops for every interaction, we conclude that there are an infinite number of sea quarks (can also be gluons by the way).
In response to your question about this being a problem, well, to an extent it is. In QED (electrons and photons remember, not quarks) we interpret these "interactions with infinite parts" in this way: To get the overall interaction mathematically, we must add together all of the infinite diagrams together, but in QED, the more loops the diagram possesses, the less it contributes to the overall interaction, this addition becomes a convergent series and can be solved through perturbation techniques.
However, in QCD this series doesn't lessen due to the strength of the appropriately named strong force.
As such each of the infinite diagrams makes an non-negligible contribution to the interaction.
This is an unsolved problem in theoretical physics. There are suggested solutions, the one with the most success so far is Lattice QCD. This involves performing calculations for QCD phenomenon (energy levels, coupling strengths) in a discrete space-time, and extrapolating to the continuum limit.
If you are confused by my description of Lattice QCD, firstly I don't blame you, it's not a simple idea. My favourite guide can be found here: http://arxiv.org/abs/hep-ph/0205181
I feel the need to summarize this answer, the problem is that summarizing QCD almost always involves making something wrong, but here goes: All Quantum Field theory interactions involve us having to account for an infinite number of created an annihilated pairs that could occur in our calculations. These don't technically exist in the way valence particles do but they effect the interaction all the same and give us infinities in our calculations, but theoretical methods like Lattice QCD offer us ways around this. The sea quarks may spontaneously pop in and out of existence in finite numbers, but these have no measurable effects outside the hadron.