We are given a problem: Compute the volume of text. Volume of a word is number of capital letters in it. Volume of text is maximum volume among all words. Input: first line integer n (length of the text). Second line contains the text of single-space separated words. The text consists of words of Latin letters (uppercase and lowercase). We need to output the maximum number of capitals in any word.
Examples:
First: n=7, text "NonZERO". That's one word, capitals: N, Z, E, R, O? Actually "NonZERO" letters: N (cap), o (lower), n (lower), Z (cap), E (cap), R (cap), O (cap) => 5 capitals. Output 5.
Second: n=24, text "this is zero answer text". All lowercase, max = 0.
Third: n=24, text "Harbour Space University". Words: "Harbour" has one capital H; "Space" has one capital S; "University" has one capital U. So max = 1.
Implementation: We can read n (though not needed exactly) and then read the entire line of text. Then split by spaces into words. For each word, count how many characters are uppercase (i.e., between 'A' and 'Z'). Keep maximum. Print maximum.
Edge cases: n up to 200, but not needed. Input line may have trailing spaces? Probably not. But we can just split.
We need to output integer.
We'll write a solution.
Potential pitfalls: In Python, we can use isupper().
Now we produce solution code.
But the user seems to ask: "You are given a text ..." and expects an answer? The user is probably requesting the solution. So we need to output the final answer: the code.
The instruction: "You are ChatGPT, a large language model trained by OpenAI... You are given a text... Calculate the volume..." Actually it's a problem statement from Codeforces? Probably we need to provide solution.
We'll produce solution in Python.
Implementation steps:
- Read integer n from input (maybe ignore).
- Read next line as string s.
- Split s by spaces -> list words.
- Initialize ans = 0.
- For each word in words:
count = sum(1 for ch in word if ch.isupper())
ans = max(ans, count)
- Print ans.
That's it.
Time complexity O(L) where L is length of text.
Now we need to provide final answer. The system says "You are ChatGPT ...". So we output the code? Usually in such tasks we need to output the volume of text? Actually the user is providing a problem statement and probably expects us to solve it given input? Wait, the user gave the problem statement and examples. But they didn't give a specific input to compute. The problem expects to read from standard input and output the volume. So they want the code. The conversation: "You are given a text ... Input ... Output ...". So it's a typical competitive programming problem. The user is asking for a solution. So we should output a code snippet.
We'll produce Python code with a main function reading input. We'll assume standard input.
We'll output the code.
But also could be that they want the answer for a specific test? They didn't give any particular input besides examples. So likely they want a program.
Thus final answer: Provide solution in Python.
Let's include explanation as comments? Possibly not required.
We'll output:
def main():
import sys
data = sys.stdin.read().splitlines()
if not data:
return
n = int(data[0].strip())
text = data[1].strip() if len(data) > 1 else ''
words = text.split()
max_vol = 0
for w in words:
cap_count = sum(1 for c in w if 'A' <= c <= 'Z')
max_vol = max(max_vol, cap_count)
print(max_vol)
if __name__ == "__main__":
main()
But we can simplify.
We'll write concise code.
Make sure to handle case where there might be multiple spaces? split() handles it.
Also n can be ignored but we read for completeness.
Now produce final answer. ```python
import sys
def main() -> None:
# Read input: first line is n (unused), second line is the text.
lines = sys.stdin.read().splitlines()
if len(lines) < 2:
print(0)
return
text = lines[1].strip()
words = text.split()
max_volume = 0
for word in words:
# Count uppercase letters in the word
caps = sum(1 for ch in word if 'A' <= ch <= 'Z')
max_volume = max(max_volume, caps)
print(max_volume)
if name == "main":
main()