  We consider the Friedel sum rule in the context of the scattering theory for
the Schr\"odinger operator $-\Dc_x^2+V(x)$ on graphs made of one-dimensional
wires connected to external leads. We generalize the Smith formula for graphs.
We give several examples of graphs where the state counting method given by the
Friedel sum rule is not working. The reason for the failure of the Friedel sum
rule to count the states is the existence of states localized in the graph and
not coupled to the leads, which occurs if the spectrum is degenerate and the
number of leads too small.
