Haskell, 130130 123 bytes
This is not a challenge for Haskell. Also I am in golfing this.
Thanks to @nimi.
import Data.List
f=g.sort
g(x:a@(y:z:b))|x==y&&y==z=100*h|x>z=j x+g b|0<1=ja|0<1=100*h x+g ab
g(x:y)=j x+g ya
g _=0
h 1=10
h x=x
j 1=100
j 5=50
j _=0