Create Hat trick

"In football, it is said that a player makes a hat trick when he scores three or more goals in a match. Cristiano Ronaldo has had 27 hat tricks , which is remarkable (and of course we hope he will have another one tonight ...), but still far from the record of Pelé, who made ​​92 over the 21 years of his career (1956-1977).

We have a list of all games in which Cristiano Ronaldo came in, with the number of goals he scored. The list is a list of natural numbers, only: the number of goals scored by Cristiano in each game.

With this list, we want to see if Cristiano is increasing the frequency of hat tricks, as his career progresses, or not, ie, if he had more hat tricks when he was younger than now.

Specifically, we want to know how many hat tricks he had in the first group of 32 matches of his career, how many in the second group of 32 matches, etc., up to the present. If the number of games is not a multiple of 32, the last group will have less than 32 games, but we also want to know how many hat tricks he had in that group.

In general, we want to be able to do this analysis for groups of any size, given in the input.

Task

Write a program that reads the size of the groups of matches to analyse and then a sequence of numbers (until the end of the data) representing the goals scored by Cristiano Ronaldo in every game of his career and computes and writes a list of numbers representing the number of hat tricks in each group of matches (the size of each group has been indicated in the first number read) starting in the beginning of his career, as explained."