# How many parse trees are there of a given string?

Given a CFG, is there a systematic way to figuring out how many parse trees there are for a certain string?

For example, given the grammar:

S → AB | C
A → aAb | ab
B → cBd | cd

How many distinct parse trees are there for the string aabbccdd