counting sort for finding F column