OK, that helps.
This is a purely mathematical question. You'll need a function to tell you if a given year is a leap year or not. It so happens that the Delphi VCL has a function that does just that: uses SysUtils;
function IsLeapYear( year: word ): boolean;
Now think about how you can use that function to check each year for a leap year, and count how many leap years you find.
Hint: get out the construction paper and crayons and do it there first. This helps me all the time because by first solving the problem without the computer I have a better idea of how to tell the computer how to solve the problem.
Once you get some code together, post back here.