On determination of the number of factors in an approximate factor model