The parity of the number of atoms in finite antiferromagnetic nanowires deposited on ferromagnets is shown to be a crucial quantity determining their magnetic ground state. Relating results of the full-potential Korringa-Kohn-Rostoker method for noncollinear magnetism from first principles to a Heisenberg model, we show that the magnetic structure changes dramatically across the entire nanowire if one single atom is added to it. Infinite and finite even-numbered nanochains exhibit always noncollinear magnetism, while odd-numbered wires lead under given conditions to a collinear ferrimagnetic ground state. This extremely nonlocal effect occurs only for nanosized wires.