Mesoscopic systems with fixed number of electrons