All problems

Problem 787

Count Uppercase and Lowercase Letters

Easy · 10 pts · String, Basics

Problem

A word is made of English letters. Count how many of its letters are uppercase (A to Z) and how many are lowercase (a to z), and print both counts. You can compare each character with the ranges 'A'..'Z' and 'a'..'z', or use your language's isupper / islower helpers.

Input

A single word W of English letters.

Output

Print the number of uppercase letters and the number of lowercase letters, separated by a space.

Constraints

1 <= |W| <= 100000

Example input

HelloWorld

Example output

2 8

Explanation

In HelloWorld the uppercase letters are H and W, and the other 8 letters are lowercase, so the answer is 2 8.

Every problem here can be used in a RelayTrixCode team match. Create a room.

Previous: Count Elements Greater Than X Next: Remove Vowels from a String