More efficient counting, bigger input