some dummy content ${config2.first.placeholder}. other context on same line ${config2.second.placeholder}

no need to count! There are in total 5 unique placeholders:
config2.first.placeholder
config2.second.placeholder
config2.third.placeholder
config2.duplicate.placeholder
config2.last.placeholder