Centralizers and the maximum size of the pairwise noncommuting elements in finite groups