A. Text Volume

Codeforces
IDCF837A
Time1000ms
Memory256MB
Difficulty
implementation
English · Original
Chinese · Translation
Formal · Original
You are given a text of single-space separated words, consisting of small and capital Latin letters. _Volume_ of the word is number of capital letters in the word. _Volume_ of the text is maximum _volume_ of all words in the text. Calculate the _volume_ of the given text. ## Input The first line contains one integer number _n_ (1 ≤ _n_ ≤ 200) — length of the text. The second line contains text of single-space separated words _s_1, _s_2, ..., _s__i_, consisting only of small and capital Latin letters. ## Output Print one integer number — _volume_ of text. [samples] ## Note In the first example there is only one word, there are _5_ capital letters in it. In the second example all of the words contain _0_ capital letters.
给定一个由空格分隔的单词组成的文本,单词仅包含小写和大写拉丁字母。 一个单词的 _体积_ 是其中大写字母的数量。文本的 _体积_ 是文本中所有单词的最大 _体积_。 请计算给定文本的 _体积_。 第一行包含一个整数 #cf_span[n] (#cf_span[1 ≤ n ≤ 200]) — 文本的长度。 第二行包含由空格分隔的单词 #cf_span[s1, s2, ..., si] 的文本,仅由小写和大写拉丁字母组成。 请输出一个整数 — 文本的 _体积_。 在第一个示例中,只有一个单词,其中包含 _5_ 个大写字母。 在第二个示例中,所有单词都包含 _0_ 个大写字母。 ## Input 第一行包含一个整数 #cf_span[n] (#cf_span[1 ≤ n ≤ 200]) — 文本的长度。第二行包含由空格分隔的单词 #cf_span[s1, s2, ..., si] 的文本,仅由小写和大写拉丁字母组成。 ## Output 请输出一个整数 — 文本的 _volume_。 [samples] ## Note 在第一个示例中,只有一个单词,其中包含 _5_ 个大写字母。在第二个示例中,所有单词都包含 _0_ 个大写字母。
**Definitions** Let $ n \in \mathbb{Z} $ be the length of the text (number of characters). Let $ S $ be a string of length $ n $, consisting of single-space-separated words made of uppercase and lowercase Latin letters. Let $ W = \{w_1, w_2, \dots, w_m\} $ be the set of words obtained by splitting $ S $ by spaces, where $ m $ is the number of words. For a word $ w \in W $, define its *volume* as: $$ \text{vol}(w) = \left| \{ c \in w \mid c \text{ is an uppercase Latin letter} \} \right| $$ The *volume of the text* is: $$ \text{vol}(S) = \max_{w \in W} \text{vol}(w) $$ **Constraints** 1. $ 1 \leq n \leq 200 $ 2. Each character in $ S $ is either an uppercase Latin letter (A–Z), lowercase Latin letter (a–z), or a space. 3. Words are separated by single spaces; no leading, trailing, or consecutive spaces. **Objective** Compute $ \text{vol}(S) = \max_{w \in W} \text{vol}(w) $.
Samples
Input #1
7
NonZERO
Output #1
5
Input #2
24
this is zero answer text
Output #2
0
Input #3
24
Harbour Space University
Output #3
1
API Response (JSON)
{
  "problem": {
    "name": "A. Text Volume",
    "description": {
      "content": "You are given a text of single-space separated words, consisting of small and capital Latin letters. _Volume_ of the word is number of capital letters in the word. _Volume_ of the text is maximum _vo",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF837A"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given a text of single-space separated words, consisting of small and capital Latin letters.\n\n_Volume_ of the word is number of capital letters in the word. _Volume_ of the text is maximum _vo...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "给定一个由空格分隔的单词组成的文本,单词仅包含小写和大写拉丁字母。\n\n一个单词的 _体积_ 是其中大写字母的数量。文本的 _体积_ 是文本中所有单词的最大 _体积_。\n\n请计算给定文本的 _体积_。\n\n第一行包含一个整数 #cf_span[n] (#cf_span[1 ≤ n ≤ 200]) — 文本的长度。\n\n第二行包含由空格分隔的单词 #cf_span[s1, s2, ..., si] 的文本...",
      "is_translate": true,
      "language": "Chinese"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the length of the text (number of characters).  \nLet $ S $ be a string of length $ n $, consisting of single-space-separated words made of uppercase and l...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments