If 'g' and 'm' represent the numbers of times a square and a quadrilateral resume their initial positions while rotating, then find the value of g × m.