#C2853. Domino Orientation Counter
Domino Orientation Counter
Domino Orientation Counter
You are given a string representing a row of dominoes. Each domino is in one of three states:
|
representing a vertically standing domino./
representing a domino fallen to the left.\
representing a domino fallen to the right.
Your task is to count and output the number of dominoes that are either vertical or have fallen to the right. In other words, compute the number of characters in the input string that are equal to |
or \
.
Note: If there are any mathematical formulas in the problem statement, they must be written in LaTeX format. In this problem, the operation is simply a count:
\( \text{answer} = \#\{ c \in \text{dominoes} : c = '|' \text{ or } c = '\\' \} \)
inputFormat
The input consists of a single line containing a string of characters. Each character is either |
, /
, or \
, representing the state of a domino.
Read the input from stdin.
outputFormat
Print a single integer representing the count of dominoes that are vertical (|
) or fallen to the right (\
).
Write the output to stdout.
## sample|||||
5