Triangle and Square Counting Part1