Digital Counter problem