How happy is this emoticon? 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:

:(  -&gt; 0
:-| -&gt; 1
:D  -&gt; 3
:-) -&gt; 2
:|  -&gt; 1


This is a code golf challenge, shortest answer per language wins.
Python 3, 26 bytes



lambda s:ord(s[-1])*2%19%4


Try it online!

$$ f(x) = (2x \bmod 19) \bmod 4 $$