Triangle and Square Counting Part3