# [Haskell], 122 bytes

<!-- language-all: lang-hs -->

    n 'n'=21
    n '='=14
    n ' '=14
    n '\n'=12
    n '\\'=4
    n '\''=32
    n '0'=2
    n '1'=5
    n '2'=5
    n '3'=3
    n '4'=5
    n '5'=5
    n nnnnnn4'''''''=0

[Try it online!][TIO-jg2hnai0]

[Haskell]: https://www.haskell.org/
[TIO-jg2hnai0]: https://tio.run/##bY7BDsIgDIbvPgVZTLolMw623eyTiAcO0y1iY@a4@e4IBTwYe/k/Wpp@s3ndJ2u9JwEEqOQuAALKIYIooMNMKiYNmFoA2HOrC3sxJeAYU@Xsw4eYQ36PKYlrgFTYeYNVua6pnGcSX9LJIDNLZGYN5ujBEEUYVIGowjCUzpjh16baPcxC@FwX2vbn2rV2ots219fFbtNaI7rGNM3bnQ6mJeGO@G9@8R8 "Haskell – Try It Online"