[Question]
  [
In this challenge, submissions will be programs or function which, when given an emoticon such as `:-)`, `:(`, or `:D`, will rate their happiness from 0 to 3.
An emoticon will be one of the following:
* `:(`: 0
* `:|`: 1
* `:)`: 2
* `:D`: 3
Emoticons may also have noses (a `-` after the `:`).
Test cases:
```
:(  -> 0
:-| -> 1
:D  -> 3
:-) -> 2
:|  -> 1
```
This is a code golf challenge, shortest answer per language wins.
  
[Answer]
# [Python 3](https://docs.python.org/3/), 26 bytes
```
lambda s:ord(s[-1])*2%19%4
```
[Try it online!](https://tio.run/##K6gsycjPM/6fpmCrEPM/JzE3KSVRodgqvyhFozha1zBWU8tI1dBS1eR/am5@SWZyfl4xUGE0l4KCkpWuhpIOmFEDpTWhtK6LElcsF1dafpFCqkJmngJcqxVQuqAoM69EI00jVVPzPwA "Python 3 ‚Äì Try It Online")
$$ f(x) = (2x \bmod 19) \bmod 4 $$
[Answer]
# [Ruby](https://www.ruby-lang.org/), 20 bytes
`s[-1].ord` will give us the codepoint of the last character in the string, which we can then plug into this formula:
$$(160 \bmod c) \bmod 7 $$
```
->s{160%s[-1].ord%7}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf16642tDMQLU4WtcwVi@/KEXVvPZ/QWlJsUJatJKVhlIsF5xTg8zRROa4IHN0UTTpoujSRdGmC9T3HwA "Ruby ‚Äì Try It Online")
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), ~~11~~ 8 bytes
*3 bytes saved thanks to @Bubbler!*
```
‚äÉ'(|)'‚ç≥‚åΩ
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///qG@qp/@jtgkG/9OA5KOuZnWNGk31R72bH/Xs/f8/TUHdSkOdC0TVQChdKK0JoVygoi7qAA)
```
       ‚åΩ  reverse the string
‚äÉ         take the last (now first) byte
 '(|)'‚ç≥    index inside '(|)' (if not found ('D') returns the length (3))
```
[Answer]
# [Python 3](https://docs.python.org/3/), ~~28~~ 27 bytes
```
lambda e:"(|)D".find(e[-1])
```
[Try it online!](https://tio.run/##K6gsycjPM/6fpmCrEPM/JzE3KSVRIdVKSaNG00VJLy0zL0UjNVrXMFbzf2pufklmcn5eMVBlNJeSlaaSDpDUdQFTNRCOhhJXLBdXWn6RQqpCZp4CXIsVl4JCQVFmXolGmkaqpuZ/AA "Python 3 ‚Äì Try It Online")
Because we don't care about the eyes/nose, we can just look at the mouth (the last character) and find its index in a string with all the mouths, ordered from saddest to happiest :) Thanks @Surculose Sputum!
[Answer]
# [Python 3](https://docs.python.org/3/), 25 bytes
```
lambda s:160%ord(s[-1])%7
```
[Try it online!](https://tio.run/##K6gsycjPM/6fpmCrEPM/JzE3KSVRodjK0MxANb8oRaM4WtcwVlPV/H9BUWZeiUaaRmZeQWmJhqam5n8rXRcA "Python 3 ‚Äì Try It Online")
Math taken from @dingledooper
[Answer]
## Excel, 25 bytes
```
=FIND(RIGHT(A1),"(|)D")-1
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~¬†37¬†~~ 33 bytes
*Saved 4 bytes on both versions thanks to @ceilingcat and @dingledooper*
I overlooked the rule about the optional nose, so this is not as effective as expected.
```
f(char*s){s=390%~-s[*++s%9<1]&3;}
```
[Try it online!](https://tio.run/##S9ZNT07@/z9NIzkjsUirWLO62NbY0kC1Trc4Wktbu1jV0sYwVs3YuvZ/WX5mikJuYmaehqZCNZeCQkFRZl5JmgaQpaCgpJqigA0p6YCl0zSUrDSUNBEcXRReDYoUCk8TRQqF54IiBeQBOZrWXLX//yWn5SSmF//XLQcA "C (gcc) ‚Äì Try It Online")
### How?
Among the characters that we have to deal with, the hyphen is the only one whose ASCII code is congruent to \$0\$ modulo \$9\$. We use this property to decide whether we need to work on the second or the third character.
Given the ASCII code \$n\$ of the relevant smiley character, we apply the following formula to get the happiness:
$$h(n)=(390\bmod (n-1))\bmod 4$$
---
# [C (gcc)](https://gcc.gnu.org/), ~~¬†36¬†~~ 32 bytes
Using [Uriel's formula](https://codegolf.stackexchange.com/a/202898/58563) is 1 byte shorter.
```
f(char*s){s=s[*++s%9<1]*2%19&3;}
```
[Try it online!](https://tio.run/##S9ZNT07@/z9NIzkjsUirWLO62LY4Wktbu1jV0sYwVstI1dBSzdi69n9ZfmaKQm5iZp6GpkI1l4JCQVFmXkmaBpCloKCkmqKADSnpgKXTNJSsNJQ0ERxdFF4NihQKTxNFCoXngiIF5AE5mtZctf//JaflJKYX/9ctBwA "C (gcc) ‚Äì Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~8~~ 7 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
‚ÅΩ$9,4·∏•‚Äô
```
A monadic Link accepting a list of characters which yields an integer in \$[0,3]\$.
**[Try it online!](https://tio.run/##y0rNyan8//9R414VSx2ThzuWPmqY@f//fysXAA "Jelly ‚Äì Try It Online")**
### How?
```
‚ÅΩ$9,4·∏•‚Äô - Link: list of characters, A
‚ÅΩ$9     - base 250 literal = 10058
   ,4   - pair with four
     ·∏•  - Jelly hash A using 10058 as a salt and [1,2,3,4] as the domain
      ‚Äô - decrement
```
---
Previous **8** byter:
```
‚Äú|)D‚Äùi‚±ÆS
```
[Try it online!](https://tio.run/##y0rNyan8//9Rw5waTZdHDXMzH21cF/z//38rFwA "Jelly ‚Äì Try It Online")
### How?
```
‚Äú|)D‚Äùi‚±ÆS - Link: list of characters, A             e.g. ":-)"     OR  ":-("
      ‚±Æ  - map across c in A with:
     i   -   first index of c in (or 0 if not found):
‚Äú|)D‚Äù    -     list of characters = "|)D"               [0,0,2]       [0,0,0]
       S - sum                                          2             0
```
[Answer]
# [Raku](https://github.com/nxadm/rakudo-pkg), 19 bytes
```
{TR:d/(|)D:-/0123/}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/OiTIKkVfo0bTxUpX38DQyFi/9n9xYqWCHlA2Lb9IISczL7X4v5UGl5VuDZeVC5DS5LKqAQA "Perl 6 ‚Äì Try It Online")
[Answer]
# [Bash](https://www.gnu.org/software/bash/) + GNU utilities, 17 bytes
```
tr '(|)D:-' 0-3\ 
```
[Try it online!](https://tio.run/##S0oszvj/v6RIQV2jRtPFSlddwUDXOEbh/38rDS4r3RouKxcgpcllVQMA "Bash ‚Äì Try It Online")
*Note: There's a space character after the backslash.*
Input on stdin, output on stdout.
The challenge doesn't specify the format of the output. Depending on the input, this program may print the output in either %2d or %3d format (that is, with one or two spaces before the 0, 1, 2, or 3). 
If that's not acceptable, then
`tr -s '(|)D:-' 0-3\`
**(20 bytes)** always prints the digit in %2d format. (There's a space after the backslash here too.)
Or
`tr '(|)D:-' 0-4|tr -d 4`
**(23 bytes)** prints just the digit (with no spaces).
[Answer]
# Mornington Crescent, 1820 bytes
[Try it online!](https://tio.run/##vZXBTsJAEIbvPsWeNB7wAbxJPZgIprHofbIdYcJ2BqeDiU@Pi0ATpG2KBS497P91@v8zu9tClImnJjzwiqVHttVqAnN0L6I2Q2U3IkZn4kZIHktDddnnEhSvjsFS8h5yCuG7AidL5QVFbQTcl@rl7QBLZqCxKS5RKcvuzDA@NIhUzO@Cy0wRrQFJIc83/W8Aunyni9@xiE7BtpETUh@wQRyjqSwkkMFe3vAhbO46TsKoQG2Bn6Obm3LjJ@a/izHZK2y9vZM3UYIKz/AL2WW0nkwTs1uo9d8qDoHntcITFDFGWZDNavUEmIX35nfyCt3NPcb2aMxZEW@Lgnjdsga9f4X/9/wh5I2bbU/rv9fSeG3F4@NeBfIW7PAs9qmWEvMpXJ3hoLSX/DOLdvis0S/TwqPy1lyau79jfGX3d7wf3P4A)
A port of @dingledooper's fantastic Ruby answer, which just so happens to work seamlessly in Mornington Crescent because of a convenient `7` in it. Props to them!
```
Take Northern Line to Leicester Square
Take Northern Line to Leicester Square
Take Piccadilly Line to Turnpike Lane
Take Piccadilly Line to Turnpike Lane
Take Piccadilly Line to Leicester Square
Take Northern Line to Leicester Square
Take Northern Line to Charing Cross
Take Northern Line to Charing Cross
Take Bakerloo Line to Baker Street
Take Bakerloo Line to Paddington
Take Bakerloo Line to Charing Cross
Take Bakerloo Line to Charing Cross
Take Northern Line to Moorgate
Take Circle Line to Moorgate
Take Metropolitan Line to Chalfont & Latimer
Take Metropolitan Line to King's Cross St. Pancras
Take Victoria Line to Seven Sisters
Take Victoria Line to Victoria
Take Circle Line to Victoria
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Cannon Street
Take Circle Line to Hammersmith
Take Circle Line to Cannon Street
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Victoria
Take Circle Line to Victoria
Take Circle Line to Aldgate
Take Circle Line to Aldgate
Take Metropolitan Line to Chalfont & Latimer
Take Metropolitan Line to Preston Road
Take Metropolitan Line to Baker Street
Take Metropolitan Line to Preston Road
Take Metropolitan Line to Pinner
Take Metropolitan Line to Preston Road
Take Metropolitan Line to King's Cross St. Pancras
Take Victoria Line to Seven Sisters
Take Victoria Line to King's Cross St. Pancras
Take Circle Line to King's Cross St. Pancras
Take Metropolitan Line to Pinner
Take Metropolitan Line to Preston Road
Take Metropolitan Line to Pinner
Take Metropolitan Line to Preston Road
Take Metropolitan Line to King's Cross St. Pancras
Take Circle Line to King's Cross St. Pancras
Take Northern Line to Mornington Crescent
```
The only major thing I feel I need to point out is how I got `160` in the program. To do this, I took the first letter of `Paddington`, which gives an ASCII value of `80` when run through Charing Cross, then multiplied it by `2` in Chalfont & Latimer to get `160`. Subsequently, the program computes `160 % (ASCII of last character) % 7` via Preston Road, the formula found by @dingledooper.
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), ~~16~~ 12 bytes
```
T`-:(|)D`__d
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7wPyRB10qjRtMlIT4@5f9/K00uK10XLqsaIKUBxEAukKcL5GoAAA "Retina 0.8.2 ‚Äì Try It Online")
```
T`
```
Enter transliteration mode
```
(|)D`d
```
Replace the mouth character with the corresponding digit (0 to 3)
```
-:`__
```
Remove each of `-` and `:` from the string.
Implicitly output the result, which will be a single digit.
[Answer]
# [MATL](https://github.com/lmendo/MATL), 9 bytes
```
'|)D'jmfs
```
[Try it online!](https://tio.run/##y00syfn/X71G00U9Kzet@P9/K10XAA "MATL ‚Äì Try It Online")
### Explanation
```
'|)D' % Push this string
j     % Read input as unevaluated string
m     % ismember: true for chars of the first string that are present in the second
f     % find: (1-based) indices of true entries. The result will have length 0 or 1
s     % sum. This is needed to transform an empty array into 0
      % Implicitly display
```
[Answer]
# [Keg](https://github.com/JonoCode9374/Keg), `-hr`, 18 bytes
```
?^‚ëµ¬¶P0|\üÑÉ1|R2|\¬¶3‚Ñ¢
```
[Try it online!](https://tio.run/##y05N///fPu7RxK2HlgUY1MR8mN/SbFgTZFQTc2iZ8aOWRf//W@mCgOZ/3YwiAA "Keg ‚Äì Try It Online")
The same switch statement format, but with a different character checking criteria.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 8 bytes
```
Œ∏√áx19%4%
```
[Try it online!](https://tio.run/##yy9OTMpM/f//3I7D7RWGlqomqv//W7kAAA "05AB1E ‚Äì Try It Online")
### Explanation
I used Uriel's formula.
```
Œ∏        # Get mouth (last char)
 √á       # ASCII value
  x      # Multiply by 2
   19%   # Modulo 19
      4% # Modulo 4
```
[Answer]
# [Perl 5](https://www.perl.org/) `-p`, 24 bytes
```
s/.*(.)/ord($1)*2%19%4/e
```
[Try it online!](https://tio.run/##K0gtyjH9/79YX09LQ09TP78oRUPFUFPLSNXQUtVEP/X/fysNLivdGi4rFyClyWVV8y@/oCQzP6/4v25BDgA "Perl 5 ‚Äì Try It Online")
Steals the math from @Uriel's Python answer
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 10 bytes
```
Ôº©‚åï(|)D¬ßÔº≥¬±¬π
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMM5sbhEwy0zL0VDSaNG00VJR8GxxDMvJbVCwzOvoLQkuASoKl1DU0fBLzU9sSRVw1ATBKz//7fS1fyvW5YDAA "Charcoal ‚Äì Try It Online") Link is to verbose version of code. Explanation:
```
       Ôº≥    Input string
      ¬ß     Cyclically indexed by
         ¬π  Literal 1
        ¬±   Negated
 ‚åï          Find index in
  (|)D      Literal string of mouths
Ôº©           Cast to string
            Implicitly print
```
[Answer]
# [Io](http://iolanguage.org/), 31 bytes
Io's strings are made of integers, so character-converting is unneccecary. Although Io doesn't allow us to index the last item of a sequence using `last()`...
```
method(x,160%x reverse at(0)%7)
```
[Try it online!](https://tio.run/##y8z/n5FYUFCpYGWrEPM/N7UkIz9Fo0LH0MxAtUKhKLUstag4VSGxRMNAU9VcE6JUQ8lKV1NJU6GgKDOv5D8A "Io ‚Äì Try It Online")
[Answer]
# [naz](https://github.com/sporeball/naz), 120 bytes
```
8a5m2x1v1a2x2v4a2x3v9a9a5a2x4v1x1f2r3x3v1e2f0x1x2f3x1v3e3x2v5e3x4v6e4f0x1x3f0m1o0x1x4f0m1a1o0x1x5f0m2a1o0x1x6f0m3a1o0x1f
```
**Explanation** (with `0x` commands removed)
```
8a5m2x1v                 # Set variable 1 equal to 40 ("(")
1a2x2v                   # Set variable 2 equal to 41 (")")
4a2x3v                   # Set variable 3 equal to 45 ("-")
9a9a5a2x4v               # Set variable 4 equal to 68 ("D")
1x1f                     # Function 1
    2r                   # Read the second byte in the input string, removing it
      3x3v1e             # Jump back to the start of the function if it equals variable 3
            2f           # Otherwise, jump to function 2
1x2f                     # Function 2
    3x1v3e               # Jump to function 3 if the register equals variable 1
          3x2v5e         # Jump to function 5 if the register equals variable 2
                3x4v6e   # Jump to function 6 if the register equals variable 4
                      4f # Otherwise, jump to function 4
1x3f                     # Function 3
    0m1o                 # Output 0
1x4f                     # Function 4
    0m1a1o               # Output 1
1x5f                     # Function 5
    0m2a1o               # Output 2
1x6f                     # Function 6
    0m3a1o               # Output 3
1f                       # Call function 1
```
[Answer]
# [Red](http://www.red-lang.org), 32 bytes
```
func[s][select"(0|1)2D3"last s]
```
[Try it online!](https://tio.run/##K0pN@R@UmhIdy5Vm9T@tNC85ujg2ujg1JzW5REnDoMZQ08jFWCknsbhEoTiW639aflFqYnKGQmpuflZmNJcCEChZaShBGbo1MJYLXEgTxgLKxUJ0FBRl5pUoRBckpigAzcuFGKZgrKCka6ekkAbhxnLF/gcA "Red ‚Äì Try It Online")
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), ~~17~~ 14 bytes
Turns out Ranges finally started to actually exist and work! Thanks to an anonymous user for pointing this out (by proposing an edit, but anonymous users cannot comment...)
```
s=>160%s[^1]%7
```
[Try it online!](https://tio.run/##Sy7WTS7O/O9WmpdsU1xSlJmXrqOQmVdip@CmYKvwv9jWztDMQLU4Os4wVtX8vzVXAFBFiYabhpKVhpKmJjK/Bo2vicZ3QeProhugi26CLroRumAz/gMA "C# (Visual C# Interactive Compiler) ‚Äì Try It Online")
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 8 bytes
```
x"(|)D"e
```
[Try it online!](https://tio.run/##K6gsyfj/v0JJo0bTRSn1/38lKxclAA "Pyth ‚Äì Try It Online")
### Exalanation
```
x"(|)D"e
          : Implicit evaluated input
       e  : Last element of input
 "(|)D"   : The string "(|)D"
x         : First occurrence of the last element of input in "(|)D"
```
[Answer]
# JavaScript, ~~35~~ ~~32~~ 29 bytes
I based the logic off of the Java solution submitted April 2 and edited April 8, by branboyer. I suppose it would be referred to as a port of their answer, but I don‚Äôt know exactly how that‚Äôs supposed to be marked.
```
a=>"(|)D".indexOf(a[2]||a[1])
```
An anonymous function, taking a string and returning an integer. Please help me shorten it further, I‚Äôm new to golfing code. Just the code, without the way of inputting (no idea how to get input in try it online) is at this [Try it online link](https://tio.run/#%23y0osSyxOLsosKNFNSkxKzdHNy09J/Z9m@z/R1k5Jo0bTRUkvMy8ltcI/TSMxOlEvJzUvvSRD1zBW839yfl5xfk6qXk5@ukaahpKVhpKmpoKCvr6CARe6lG4NSA4oZYgh5QLTZYypSxOqywhDqgamy/A/AA)
[Answer]
# [International Phonetic Esoteric Language](https://esolangs.org/wiki/International_Phonetic_Esoteric_Language), 11 bytes
```
i Å2f{J}‚±±4‚±±o
```
Based on [Uriel's formula](https://codegolf.stackexchange.com/a/202898/77309).
```
i Å2f{J}‚±±4‚±±o
i Å          (split the face into it's ord values)
  2f        (mouth * 2)
    {J}‚±±    (mod 19) (base 26)
        4‚±±  (mod 4)
          o (print)
```
[Answer]
# [sed](https://www.gnu.org/software/sed/), 20 bytes
```
y/(|)D/0123/;s/:-*//
```
Pretty self explanatory. Replaces the the "mouth" characters with numbers using the `y///` transform command and then strips off the eyes and the nose if they exist.
[Try it online!](https://tio.run/##Dco7CoAwEAXAfk@xgkUiLM9Pt0KqFN7BT6VolSYIEXL3mGqaidcpd3jLQxEtWByDUvlgsvXoh3HCHKHSAWWhVNMWAIKsh9vRRDCYUdSQSib1FUuafw "sed ‚Äì Try It Online")
This is one byte longer, but perhaps it gets bonus points for having an emoticon in the code itself? `:-\`
```
y/(|)D/0123/;s/:-\?//
```
The shorter solution (16 bytes)
```
y/(|)D:-/0123  /
```
also works, but adds extra whitespace to each line of output. It also has two emoticons `D:` and `:-/`. :)
[Try it online!](https://tio.run/##K05N0U3PK/2fwVWsr6KvoGunoM9V8b9SX6NG08VKV9/A0MhYQUH/vwdXBVBBTJ6@Ppe@bnScXay@YrG@gj5IykqDy0q3hsvKBUhpclnVAAA "sed ‚Äì Try It Online")
[Answer]
# batch, ~~109 bytes~~ 99 bytes
```
@For %%G in ("(=0",")=2","D=3","|=1")Do @Set %%G
@Set "T=%~1"
@<Nul Call Call Set/P"=%%%T:~-1%%%"
```
[![output (TIO unavailable)](https://i.stack.imgur.com/cC57c.png)](https://i.stack.imgur.com/cC57c.png)
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 9 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
"(|)D"bU√å
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=Iih8KUQiYlXM&input=IjooIg)
[Answer]
# [Erlang (escript)](http://erlang.org/doc/man/escript.html), 32 bytes
The verbosity offseted the bytecount.
```
h(I)->160rem lists:last(I)rem 7.
```
[Try it online!](https://tio.run/##Sy3KScxL100tTi7KLCj5z/U/Q8NTU9fO0MygKDVXISezuKTYKiexuAQoChIw1/ufm5iZpxEdq6mga8elAASZ@VblRZklqRoZGkpWuppKmpp6/wE "Erlang (escript) ‚Äì Try It Online")
[Answer]
# [W](https://github.com/A-ee/w), 7 [bytes](https://github.com/A-ee/w/wiki/Code-Page)
```
‚òªM:√π¬∑¬±‚ô•
```
Uncompressed:
```
(|)D"azx
```
## Explanation
```
         % Implicit quote
(|)D"    % The string "(|)D"
     az  % The last item of the input
       x % Where is ^ in the above string?
```
[Answer]
# [GolfScript](http://www.golfscript.com/golfscript/), 11 bytes
```
)3?11%2/(p;
```
I'm convinced my method is the smallest possible, but this isn't the best possible one - just one of the earliest low-value ones.
```
)3?11%2/(p;
)           #Pop the last element of the string (as ascii value)
 3?         #Cube the number
   11%      #Modulo 11
      2/    #Divide by 2 (round down)
        (   #Decrement by one (gotta be 0 1 2 3, not 1 2 3 4)
         p; #Print the value we want, and shunt the rest of the stack
```
I used [the following TIO](https://tio.run/##XVFRS8MwEH7vrzhSB07HGIgIDhHZFPYwFHxUH7Lmuh5kSUhS5pz97fXaKu3MS467@@77vrut1XnIPLlY19e3NIf@pStDkaSmLwSC3HqwZQRtrUvexLkQ30KMhViKD0ifvUKPCh5eF6tVcoSTlz47NB0OYHpSWZZOUyYj8mgP0nt5mLRMsaDwB6HxQBeLyjzK0EjaHMAa5I4TwvSJ8SizAlDjDk0EMv34pGkZv/fzXqxjNoTI/y9gAoojFtXkC2m2ZLYgRAu9uu@JFuUG2ySN@uTaKiDOVqOhprV0nadoey2wR3Do2e@Od8dk7EpmkawJUDprmnVNz@4GB8m7IR2ag2B9ZKjUvBLVeDvSpauO84ry1punxn6EPcWCFxaidJr7rWmtoVETsBz5PTF1KErulkaBR4cyJtW/Oy605bb2Kjez2cWw9PiJWckb4zxE2mGo6x8 "GolfScript ‚Äì Try It Online") to search for answers, and 11 popped up quite early. I also tried squares and higher powers, but they weren't as clean and short.
[Try it online!](https://tio.run/##S8/PSStOLsosKPmvZKXrovRf09je0FDVSF@jwPr/fwA "GolfScript ‚Äì Try It Online")
[Every case!](https://tio.run/##S8/PSStOLsosKPn/P1rJSkNJQcmqBkRogggXEKELFtQFi@qChXVdlGK5qrm4NI3tDQ1VjfQ1Cqy5uGpVuf5z/QcA "GolfScript ‚Äì Try It Online")
]