Count the triangles

Problem Name:
Count the triangles
Site:HackerEarth
Links:
Tags:
Problem setters: