#P1461. H Amy...10分

H Amy...10分

题目描述

Amy was a girl who loved music very much. She always wondered what if she got a band and had a live all by herself! And now in this spring she came to the high school which she liked. It was very bored for her to concentrate herself on the routine course, there were always the music, band and the coming new friends in her mind. Soon she couldn’t hold herself and decided to find her band members. But things always went bad, it was very hard for her to find a member, so she had to temporarily give up her minds. Not hot nor cold, a lonely route to home under her step and the sun seemed to go back to his home too, so that just sprinkled its few remain lights on the ground. Suddenly, there was a gentle and soft sound behind her. ‘Are you Amy?’ ‘Yes’ said Amy with perplexity. ‘I’m Jane and I know you and let’s have a band together!’ ‘But, wait, I don’t know you and why do you know about me?’ ‘There is no time to elaborate that, just for one question, will you be my band member or not?’ ‘Yes, I will’ After said that, Amy looked the girl up and down. The mysterious girl wore the same uniform to hers and seemed to be the new student in the school too. ‘That’s marvelous!’ said the girl, ‘What are you waiting for? Let’s go!’ ‘Where to go?’ ‘Just for training, my house is very big and there are many instruments in my basement and you can play with that any time you want!’ ‘Sounds very great to me, but I’m a little hungry, can we just buy some food in the supermarket?’ ‘That’s OK, buy anything you want!’ So, they went to the supermarket and Amy chose many things and soon the chart was filled up. There were many types of things in the chart and Jane paid all the things Amy bought. There were potato chips, juice, apples, oranges among the things Amy had bought. Amy was very uncomfortable for her behavior which Jane paid so many things for her soon after she stepped out of the supermarket. Amy wanted to ask for the price Jane paid but she was a litter shy to speak it to her. Jane seemed to know what Amy was thinking about and just told that there was nothing expensive, the potato is five dollars per one, and juice is ten dollars, apple is four dollars and oranges is six dollars. ‘Ok, I will pay you for that’ said Amy. ‘No, you needn’t that’s just for the meeting. So, let’s go home.’ After one happy night in Jane’s house, in the morning, Amy said goodbye to her new friend and just went home to get much money to pay back to Jane. She saw the bill last night in Jane’s house. The super market, just for simplification all the goods are represented by its first letter, for example apple is just A. When Amy collected her money. She found there was an advertisement of the super market they went yesterday and some of the price was higher than what Jane said, which the orange was just twelve dollars. Having known about that, Amy got much money but she didn’t know if she calculated right, now she went for you to ask you to write a program to read the bill and calculate the price. And Amy wanted to pay much more dollars back to Jane, so she let you just round the answer up to the next ten-dollar base if the answer modular 10 doesn’t equal to zero.

输入格式

One line a string represents the bill which only contains letters P, J, A and O. The length of the bill is less than one million.

输出格式

One positive integer represents the price.

样例

PPPP
20
PPP
20