# [PHP], 55 bytes

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

 fn($a)=>array_sum(array_map(fn($v)=>'0002040'[$v],$a));

[Try it online!][TIO-k79m0u4g]

[PHP]: https://php.net/
[TIO-k79m0u4g]: https://tio.run/##K8go@G9jX5BRwMWlkmb7Py1PQyVR09YusagosTK@uDRXA8LKTSzQAMmVAeXUDQwMjAxMDNSjVcpidYDKNa3/pyZn5CuopGlEG@uYxgL5AA "PHP – Try It Online"