#include <iostream>
#include <string>
#include <vector>
#include <cctype>
#include <array>
using namespace std;
int maxx(array<int,26> arr){
int maximum = 0;
for(int i = 0; i < 26; i ++){
if(arr[i] > maximum) maximum = arr[i];
}
return maximum;
}
int countUpperLetters(vector<string> v) {
array<int, 26> alphabet = {0};
for(int i = 0; i < v.size(); i++) {
for(char c: v[i]) {
if (isalpha(c) && isupper(c)) {
alphabet[c - 'A']++; // Count uppercase letters
}
}
}
return maxx(alphabet);
}
int countLowerLetters(vector<string> v) {
array<int, 26> alphabet = {0};
for(int i = 0; i < v.size(); i++) {
for(char c: v[i]) {
if (isalpha(c) && islower(c)) {
alphabet[c - 'a']++; // Count lowercase letters
}
}
}
return maxx(alphabet);
}
int main() {
vector<string> evens;
vector<string> odds;
string input;
// Your logic to fill the vectors with input strings
while (getline(cin, input)) {
if (input.empty()) break;
if(input.size() % 2 == 0)
evens.push_back(input);
else
odds.push_back(input);
}
cout << countLowerLetters(evens) << " " << countUpperLetters(odds) << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dmVjdG9yPiAKI2luY2x1ZGUgPGNjdHlwZT4KI2luY2x1ZGUgPGFycmF5PiAKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYXh4KGFycmF5PGludCwyNj4gYXJyKXsKICAgIGludCBtYXhpbXVtID0gMDsKICAgIGZvcihpbnQgaSA9IDA7IGkgPCAyNjsgaSArKyl7CiAgICAgICAgaWYoYXJyW2ldID4gbWF4aW11bSkgbWF4aW11bSA9IGFycltpXTsKICAgIH0KICAgIHJldHVybiBtYXhpbXVtOwp9CgppbnQgY291bnRVcHBlckxldHRlcnModmVjdG9yPHN0cmluZz4gdikgewogICAgYXJyYXk8aW50LCAyNj4gYWxwaGFiZXQgPSB7MH07CiAgICBmb3IoaW50IGkgPSAwOyBpIDwgdi5zaXplKCk7IGkrKykgewogICAgICAgIGZvcihjaGFyIGM6IHZbaV0pIHsKICAgICAgICAgICAgaWYgKGlzYWxwaGEoYykgJiYgaXN1cHBlcihjKSkgewogICAgICAgICAgICAgICAgYWxwaGFiZXRbYyAtICdBJ10rKzsgLy8gQ291bnQgdXBwZXJjYXNlIGxldHRlcnMKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KICAgIHJldHVybiBtYXh4KGFscGhhYmV0KTsKfQoKaW50IGNvdW50TG93ZXJMZXR0ZXJzKHZlY3RvcjxzdHJpbmc+IHYpIHsKICAgIGFycmF5PGludCwgMjY+IGFscGhhYmV0ID0gezB9OwogICAgZm9yKGludCBpID0gMDsgaSA8IHYuc2l6ZSgpOyBpKyspIHsKICAgICAgICBmb3IoY2hhciBjOiB2W2ldKSB7CiAgICAgICAgICAgIGlmIChpc2FscGhhKGMpICYmIGlzbG93ZXIoYykpIHsKICAgICAgICAgICAgICAgIGFscGhhYmV0W2MgLSAnYSddKys7IC8vIENvdW50IGxvd2VyY2FzZSBsZXR0ZXJzCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CiAgICByZXR1cm4gbWF4eChhbHBoYWJldCk7Cn0KCmludCBtYWluKCkgewogICAgdmVjdG9yPHN0cmluZz4gZXZlbnM7CiAgICB2ZWN0b3I8c3RyaW5nPiBvZGRzOwogICAgc3RyaW5nIGlucHV0OwoKICAgIC8vIFlvdXIgbG9naWMgdG8gZmlsbCB0aGUgdmVjdG9ycyB3aXRoIGlucHV0IHN0cmluZ3MKICAgIHdoaWxlIChnZXRsaW5lKGNpbiwgaW5wdXQpKSB7CiAgICAgICAgaWYgKGlucHV0LmVtcHR5KCkpIGJyZWFrOwogICAgICAgIGlmKGlucHV0LnNpemUoKSAlIDIgPT0gMCkKICAgICAgICAgICAgZXZlbnMucHVzaF9iYWNrKGlucHV0KTsKICAgICAgICBlbHNlCiAgICAgICAgICAgIG9kZHMucHVzaF9iYWNrKGlucHV0KTsKICAgIH0KCiAgICBjb3V0IDw8IGNvdW50TG93ZXJMZXR0ZXJzKGV2ZW5zKSA8PCAiICIgPDwgY291bnRVcHBlckxldHRlcnMob2RkcykgPDwgZW5kbDsKCiAgICByZXR1cm4gMDsKfQo=