Number of arithmetic operations
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
You are given a string that represents a valid arithmetic expression, which includes numbers, parentheses, and various arithmetic operators similar to those used in Python: +
(addition), -
(subtraction), *
(multiplication), **
(exponentiation), /
(division), //
(floor division), and %
(modulus). Your task is to determine the total number of arithmetic operations present in the expression.
Input
A string representing an arithmetic expression that includes numbers, parentheses, and arithmetic operators.
Output
An integer representing the count of arithmetic operations in the expression.
Examples
Input #1
Answer #1
Submissions 6K
Acceptance rate 34%