The community detection is one of the main problems in social network analysis. Many methods are proposed to recover the community labels of nodes by assuming the number of communities is known. There has been an increasing interest to explore the communities number. We propose a fast method based on spectral proprieties of the graph to estimate the number K of groups. The method performs well, especially when the number of groups in network is large, and we focus on when the network is unbalanced.