Function to calculate the entropy of a String that reprensents a year