finds average number of nn