Judge a book by its cover
JavaScript (ES6),  75 74  73 bytes
Takes a single string of 36 characters as input, i.e. without any line feed.

s=&gt;s.replace(o=/[^ |_-]/g,(c,n)=&gt;t+=n*9%56%37%9&amp;1?o[c]^(o[c]=1):-1,t=0)|t

Try it online!
How?
We filter out spaces, pipes, underscores and hyphens:
/[^ |_-]/g

It means that we're going to match only:

scratches on the border (-1 point)
or non-space characters on the cover (+1 point the first time each of them appears)

Given the 0-indexed position \$n\$ of the character in the input string, the shortest solution I've found so far to figure out if we're located on the border or on the cover is the following convoluted modulo chain:
$$\big(((9\times n)\bmod 56)\bmod 37\big)\bmod 9$$
which gives:
$$\begin{pmatrix}
0&amp;1&amp;2&amp;3&amp;4&amp;5\\
6&amp;7&amp;8&amp;9&amp;10&amp;11\\
12&amp;13&amp;14&amp;15&amp;16&amp;17\\
18&amp;19&amp;20&amp;21&amp;22&amp;23\\
24&amp;25&amp;26&amp;27&amp;28&amp;29\\
30&amp;31&amp;32&amp;33&amp;34&amp;35
\end{pmatrix}
\rightarrow
\begin{pmatrix}
\color{blue}0&amp;\color{blue}0&amp;\color{blue}0&amp;\color{blue}0&amp;\color{blue}0&amp;\color{blue}8\\
\color{blue}8&amp;7&amp;7&amp;7&amp;7&amp;\color{blue}6\\
\color{blue}6&amp;5&amp;5&amp;5&amp;5&amp;\color{blue}4\\
\color{blue}4&amp;3&amp;3&amp;3&amp;3&amp;\color{blue}2\\
\color{blue}2&amp;1&amp;1&amp;1&amp;1&amp;\color{blue}0\\
\color{blue}0&amp;\color{blue}0&amp;\color{blue}8&amp;\color{blue}8&amp;\color{blue}8&amp;\color{blue}8
\end{pmatrix}$$
With even numbers on the border and odd numbers on the cover.
Generalization of the formula
Given a square matrix of width \$w&gt;3\$ whose cells are indexed from \$0\$ to \$w^2-1\$, the \$n\$-th cell is located on a border iff the result of the following expression is even:
$$\big(((p\times n)\bmod m_0)\bmod m_1\big)\bmod p$$
with:
$$p=2w-3$$
$$m_0=2\cdot (w-1)^2+w$$
$$m_1=2\cdot (w-2)^2+w-1$$
Try it online!
NB: This is an empirical result that I didn't attempt to prove.