Counting hexagons

Problem 577

An equilateral triangle with integer side length is divided into equilateral triangles with side length 1 as shown in the diagram below.
The vertices of these triangles constitute a triangular lattice with
lattice points.
Let be the number of all regular hexagons that can be found by connecting 6 of these points.
p577_counting_hexagons.png
For example, , and .
Find .