#R, <s>102</s>, <s>91</s>, 81 bytes f=function(b,v,s=table(v))(477*any(s>3)+b+10*all(s<2))%/%100+sum(s==2)+3*any(s>2) Managed to drop 11 bytes (and fix a bug) thanks to @Giuseppe. Managed a further 10 inspired by by @Giuseppe's /10 idea. Ungolfed f=function(b,v){ s = table(v) #included in fn inputs a = b+10*all(s<2) #covers all different case a = a+477*any(s>3) #Covers 4 of a kind d = sum(s==2)+3*any(s>2) #covers 1 and 2 pair, 3 of a kind. a%/%100+d #sum appropriate values } [Try it online!](https://tio.run/##TY1RCsMgEAX/e4/AblyorkoI1N4lCRUK1kJNAjm9tVpomb9h9u0rZ@/8Fpf1/oww007JrdMcbrAjghmGfooHpKtGMQsl@ykESBdG7M6dklKk7QHJOUahvyVj9iBpAUWGmCziycNoi9CkijBV8Ecw6dLonzBkC62QNbDlglvAdbPShK6blfZk/Bf5DQ)