Solution to MaxCounters.py