  (Abridged) We present a detailed analysis of the number count and photometric
redshift distribution of faint galaxies in the Hubble Deep Field (HDF), paying
a special attention to the selection effects including the cosmological dimming
of surface brightness of galaxies. We find a considerably different result from
previous studies ignoring the selection effects, and these effects should
therefore be taken into account in the analysis. We find that the model of pure
luminosity evolution (PLE) of galaxies in the Einstein-de Sitter (EdS) universe
predicts much smaller counts than those observed at faint magnitude limits by a
factor of more than 10, so that a very strong number evolution of galaxies with
\eta > 3-4 must be invoked to reproduce the I_{814} counts, when parametrized
as \phi^* \propto (1+z)^\eta. However we show that such a strong number
evolution under realistic merging processes of galaxies can not explain the
steep slope of the B_{450} and V_{606} counts, and it is seriously inconsistent
with their photometric redshift distribution. We find that these difficulties
still persist in an open universe with \Omega_0 > 0.2, but are resolved only
when we invoke a $\Lambda$-dominated flat universe, after examining various
systematic uncertainties in modeling the formation and evolution of galaxies.
The present analysis revitalizes the practice of using faint number counts as
an important cosmological test, giving one of the arguments against the EdS
universe and suggests acceleration of the cosmic expansion by vacuum energy
density. While a modest number evolution of galaxies with \eta ~ 1 is still
necessary even in a Lambda-dominated universe, a stronger number evolution with
\eta > 1 is rejected from the HDF data, giving a strong constraint on the
merger history of galaxies.
