I think that is what the modulus operator is for, but im not sure.