Counting stars through the universe