An invariant of G$_2$-structures