Description
Team ACM have a plute,he called bro.kun. One day he come to a viliage and he want to buy some foods for his wife and families.But this viliage don't support electronic payment,so he have to pay for his goods in cash.Because bro.kun is a plute,he have infinity cash(such as 1,5,10,20,50,100).And bro.kun thinks that take change is troublesome.Therefore he always give the bigger cash for every goods' price(such as 50 for 32),and call the salesman don't give change to pity and help other.So we could find that each transaction bro.kun will lost a certain number of cash.And then bro.kun want to test your ability for code.please help bro.kun to count how much cash did bro.kun pity others.
Input
the first input a integer N represent that how many goods bro.kun have bought.(0<N<20)
the next N line represent each goods' price(1~100).
Output
an integer that how much cash did bro.kun pity others.