import re
text = "contentment and maintaining are such words"
print ( [x.group() for x in re.finditer(r'\b(?=\w*(\w{2})(?:\w*\1){2})\w+', text)] )
print ( len([x.group() for x in re.finditer(r'\b(?=\w*(\w{2})(?:\w*\1){2})\w+', text)]) )
aW1wb3J0IHJlCgp0ZXh0ID0gImNvbnRlbnRtZW50IGFuZCBtYWludGFpbmluZyBhcmUgc3VjaCB3b3JkcyIKcHJpbnQgKCBbeC5ncm91cCgpIGZvciB4IGluIHJlLmZpbmRpdGVyKHInXGIoPz1cdyooXHd7Mn0pKD86XHcqXDEpezJ9KVx3KycsIHRleHQpXSApCnByaW50ICggbGVuKFt4Lmdyb3VwKCkgZm9yIHggaW4gcmUuZmluZGl0ZXIocidcYig/PVx3Kihcd3syfSkoPzpcdypcMSl7Mn0pXHcrJywgdGV4dCldKSAp