counting how many times an interesting substruct occurs in an interesting source