Constants of motion in the dynamics of a 2N-junction SQUID