A proofreading pass audits capitalization. Treat every terminator character (., !, ?) as the end of the current segment: scanning the text left to right, each terminator closes the run of characters accumulated since the previous terminator (or the start of the text). Only segments that are actually closed by a terminator are audited; any trailing text after the final terminator is ignored, and an empty segment (two terminators in a row) is ignored.
For each audited segment, find its first alphabetic character (ASCII letter). The segment is a violation if that first letter is lowercase. A segment with no alphabetic character at all is not a violation.
Report the number of violations.
Input format
The entire input is the text (it may span several lines).
Output format
A single integer: the number of violating segments.
Constraints
- 0 <= length of the input text <= 5000
- The text uses printable ASCII characters and newlines.