LearnPy Hub
← Classes & Objects problems
Easy

Click Counter

Write a Counter class with click() (adds 1), reset() and a value attribute. Read a string of commands like ccrcc (c = click, r = reset) and print the final value.

Input

One line of c and r characters.

Output

The value.

Sample 1

Input
ccrcc
Output
2

Sample 2

Input
cccc
Output
4
solution.py
Output appears here
Click Counter · Python practice problem · LearnPy Hub