Recording all keys, but only counting the first

Please don’t duplicate posts. This question was also posed here: Conditional looping

So either delete this post and continue the discussion in the previous context, or delete the existing one.