Entropy calculated from the frequency of states of individual particles