basic version
dynamic programming for counting the rountes
sol of q070