Small superconducting grain in the canonical ensemble