  We assume the space-time foam picture in which the vacuum is filled with a
gas of virtual wormholes. It is shown that virtual wormholes form a finite (of
the Planckian order) value of the energy density of zero-point fluctuations.
However such a huge value is compensated by the contribution of virtual
wormholes to the mean curvature and the observed value of the cosmological
constant is close to zero. A non-vanishing value appears due to the
polarization of vacuum in external classical fields. In the early Universe some
virtual wormholes may form actual ones. We show that in the case of actual
wormholes vacuum polarization effects are negligible while their contribution
to the mean curvature is apt to form the observed dark energy phenomenon. Using
the contribution of wormholes to dark matter and dark energy we find estimates
for characteristic parameters of the gas of wormholes.
