Create somersaults

"Each soccer player celebrates goals in their own way: some dance, others throw themselves to the ground, others suck their thumb, there are those who take off their shirts even if they get a yellow card from doing that, but for me, the most spectacular are those players who perform somersaults. My favourite is the Brazilian international Ronaldinho Luisinho, who uses a strange ritual throughout the championship. At the first goal of the season, he makes one somersault; at the second, two somersaults, at the third three somersaults, at the fourth two somersaults and then he repeats, always in the same sequence 1,2,3,2,1,2,3,2,1, ... This program calculates how many somersaults he will have performed, in all, to celebrate his goals. "