Tudor, having somehow survived yet another exam season, has decided to celebrate by preparing himself a cup of tea. Little did he know that someone snuck in some tapioca pearls into his tea. Poor Tudor, being forced to consume tapioca pearls with his tea.
Because Tudor still hasn't shaken off drinking tea from his brief stint during the summer in the United States, he consumes his tea with a straw. He begins to consume some tea via the straw. How many tapioca pearls is he going to ingest based on the contents of the straw right now?
In tests worth 5 marks, there will be at most one pearl in the straw.
The input will consist of five lines, each one corresponding to a part of the straw. For our purposes, we will assume that a tapioca pearl, if present, takes up volume equal to exactly one part of the straw.
Each line will contain a single uppercase letter, either a
T to indicate that the vertical cross-section
of that part of the straw contains only tea or a
P to indicate that it contains a single tapioca pearl.
Output, on a single line, the number of tapioca pearls currently in the straw.
P P P P P
Tudor's about to consume five tapioca pearls with the current strawful of tea. How will he survive?