24 lines
791 B
Python
24 lines
791 B
Python
|
import re
|
||
|
|
||
|
def count_characters(category, line):
|
||
|
return len(re.findall(category, line))
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
while True:
|
||
|
try:
|
||
|
line = input()
|
||
|
if not line:
|
||
|
break
|
||
|
|
||
|
# Zliczanie małych liter, dużych liter, cyfr i pozostałych znaków osobno
|
||
|
lowercase_count = count_characters(r'[a-ząćęłńóśźż]', line)
|
||
|
uppercase_count = count_characters(r'[A-ZĄĆĘŁŃÓŚŹŻ]', line)
|
||
|
digit_count = count_characters(r'\d', line)
|
||
|
other_count = count_characters(r'[^a-ząćęłńóśźżA-ZĄĆĘŁŃÓŚŹŻ\d]', line)
|
||
|
|
||
|
result = f"{lowercase_count} {uppercase_count} {digit_count} {other_count}"
|
||
|
print(result)
|
||
|
|
||
|
except EOFError:
|
||
|
break
|