"unbalanced brackets" error message

not(selected(.,'1')) or not(selected(.,'17')) or not(selected(.,'18')) and count-selected(.)>1) i use this but its saying "Unbalanced brackets or parentheses"
What could be the problem?

The 2 colors of lines in the image below show the pairs of parentheses. Note that you have a ) at the end of your expression that is missing the other side. There is a closing ) without a matched opening (.