We study the dynamical behaviour of a system that consists of one or two elongated nanomagnets. The magnets are coupled antiferromagnetically and subjected to periodically changing external magnetic field. The numerical simulation of the system reveals the possibility of chaotic behaviour.