Results Table
Time limit2sMemory limit1024 MB
Count the rows of a results table that contain at least one '+' character, which marks a solved problem.
- Level
Easy1 of 10
- Topics
- Implementation, String
- Solved
- No attempts yet
Statement
Ralph and Vanellope, while travelling through games, accidentally ended up on the computer of a programming olympiad participant. The participant was given problems, and each problem could be submitted at most times.
The results table has rows and columns. The cell in row and column contains one of the following characters:
+: the -th submission for problem is correct.-: the -th submission for problem is incorrect..: problem has no -th submission.
Vanellope explained to Ralph that only the first correct submission for each problem counts, and any later submissions do not affect the participant's result. Ralph wondered how many of the given problems the participant solved.
Input
The first line contains two integers and , the number of problems and the maximum number of submissions for one problem ().
Each of the next lines contains characters +, -, or ., describing the results table.
It is guaranteed that once a . appears in a row, only . characters follow it.
Output
Print a single integer, the number of problems the participant solved correctly.