Abrupt dimensionality crossover in thin-film ferromagnets: Quantum size effect