PROG0103 - Document properties

Most word processors show some properties of the text in a document, such as the number of words or the number of letters in that document. Write a program that can determine some of these document properties.

Input

The first line of the input contains an integer $t \in \mathbb{N}$. This is followed by $t$ lines of text. This text consists of:

  • lowercase letters (a-z) en uppercase letters (A-Z)
  • dash (-): though it may be between two spaces, it is not counted as a word
  • apostrophe ('): in the (English) text only used to indicate the contraction of two words; the fragment "It's" contains two words
  • other characters: punctuation marks such as (,),!? still cling to a word
  • white space (spaces and tabs): with the exception of the rules on the dash and the apostrophe, so you can always assume that there is at least one character white space between two words

Output

Write the following information on separate lines to the output:

  • sections: p, where $p$ represents the number of sections in the text; between two sections there is exact one blank line
  • lines: r, where $r$ is the number of lines in the text
  • words: w, where $w$ is the number of words in the text
  • characters: k, where $k$ is the number of characters in the text (exclusive of the characters used at the end of the line)
  • letters: l, where $l$ is the number of characters from the alphabet; do not distinguish between uppercase and lowercase letters
  • white space: i, where $i$ is the number of spaces and tabs
  • other: o, where $o$ is the number of characters which not a letter, space or tab; in other words: $k = l + i + o$

Example

Input:

3
A - simple? - test

To show it's (more or less) working.

Output:

sections: 2
lines: 3
words: 11
characters: 54
letters: 37
white space: 10
other: 7

Example

Input:

2
This sentence has two  spaces between some  words and contains "quotations"

Output:

sections: 1
lines: 2
words: 13
characters: 87
letters: 69
white space: 14
other: 4

Example

Input:

49
Some things in life are bad
They can really make you mad
Other things just make you swear and curse.
When you're chewing on life's gristle
Don't grumble, give a whistle
And this'll help things turn out for the best...

    And...
    Always look on the bright side of life...
    Always look on the light side of life...

If life seems jolly rotten
There's something you've forgotten
And that's to laugh and smile and dance and sing.
When you're feeling in the dumps
Don't be silly chumps
Just purse your lips and whistle - that's the thing.

    And...
    Always look on the bright side of life...
    Always look on the light side of life...

For life is quite absurd
And death's the final word
You must always face the curtain with a bow.
Forget about your sin - give the audience a grin
Enjoy it - it's your last chance anyhow.

    So always look on the bright side of death
    Just before you draw your terminal breath

Life's a piece of shit
When you look at it
Life's a laugh and death's a joke, it's true.
You'll see it's all a show
Keep 'em laughing as you go
Just remember that the last laugh is on you.

    And always look on the bright side of life...
    Always look on the right side of life...
    (Come on guys, cheer up!)
    Always look on the bright side of life...
    Always look on the bright side of life...
    (Worse things happen at sea, you know.)
    Always look on the bright side of life...
    (I mean - what have you got to lose?)
    (You know, you come from nothing - you're going back to nothing.
    What have you lost? Nothing!)
    Always look on the right side of life...

Output:

paragraphs: 8
lines: 49
words: 307
characters: 1571
letters: 1149
white space: 332
other: 90

De meeste tekstverwerkers geven een aantal eigenschappen van de tekst uit een document weer, zoals het aantal woorden of het aantal letters in dat document. Schrijf een programma dat zelf een aantal van deze documenteigenschappen kan bepalen.

Invoer

De eerste regel van de invoer bevat een getal $t \in \mathbb{N}$. Daarna volgen $t$ regels tekst. Deze tekst bestaat uit:

  • kleine letters (a-z) en hoofdletters (A-Z)
  • gedachtestreepje (-): hoewel het tussen twee spaties kan staan, wordt het niet als woord geteld
  • apostrofe ('): wordt in de (engelstalige) tekst uitsluitend gebruikt om de samentrekking van twee woorden aan te geven; het fragment "It's" bevat dus twee woorden
  • overige karakters: leestekens zoals (, ), !, ?  kleven steeds aan een woord
  • witruimte (spaties en tabs): met uitzondering van de regels voor het gedachtestreepje en de apostrofe, mag je dus steeds veronderstellen dat tussen twee woorden minstens één karakter witruimte staat

Uitvoer

Schrijf de volgende informatie op afzonderlijke regels naar de uitvoer:

  • paragrafen: p, waarbij $p$ het aantal paragrafen in de tekst voorstelt; tussen twee paragrafen staat juist één lege regel
  • regels: r, waarbij $r$ het aantal regels in de tekst voorstelt
  • woorden: w, waarbij $w$ het aantal woorden in de tekst voorstelt
  • karakters: k, waarbij $k$ het aantal karakters in de tekst voorstelt (exclusief de karakters die gebruikt worden om het einde van een regel voor te stellen)
  • letters: l, waarbij $l$ het aantal karakters voorstelt die letters uit het alfabet zijn; maak hierbij geen onderscheid tussen hoofdletters en kleine letters
  • witruimte: i, waarbij $i$ het aantal spaties en tabs voorstelt
  • overige: o, waarbij $o$ het aantal karakters voorstelt dat geen letter, spatie of tab is; met andere woorden: $k = l + i + o$

Voorbeeld

Invoer:

3
A - simple? - test

To show it's (more or less) working.

Uitvoer:

paragrafen: 2
regels: 3
woorden: 11
karakters: 54
letters: 37
witruimte: 10
overige: 7

Voorbeeld

Invoer:

2
Deze zin heeft  tussen  enkele woorden  2 spaties staan
en bevat ook "aanhalingstekens".

Uitvoer:

paragrafen: 1
regels: 2
woorden: 13
karakters: 87
letters: 69
witruimte: 14
overige: 4

Voorbeeld

Invoer:

49
Some things in life are bad
They can really make you mad
Other things just make you swear and curse.
When you're chewing on life's gristle
Don't grumble, give a whistle
And this'll help things turn out for the best...

    And...
    Always look on the bright side of life...
    Always look on the light side of life...

If life seems jolly rotten
There's something you've forgotten
And that's to laugh and smile and dance and sing.
When you're feeling in the dumps
Don't be silly chumps
Just purse your lips and whistle - that's the thing.

    And...
    Always look on the bright side of life...
    Always look on the light side of life...

For life is quite absurd
And death's the final word
You must always face the curtain with a bow.
Forget about your sin - give the audience a grin
Enjoy it - it's your last chance anyhow.

    So always look on the bright side of death
    Just before you draw your terminal breath

Life's a piece of shit
When you look at it
Life's a laugh and death's a joke, it's true.
You'll see it's all a show
Keep 'em laughing as you go
Just remember that the last laugh is on you.

    And always look on the bright side of life...
    Always look on the right side of life...
    (Come on guys, cheer up!)
    Always look on the bright side of life...
    Always look on the bright side of life...
    (Worse things happen at sea, you know.)
    Always look on the bright side of life...
    (I mean - what have you got to lose?)
    (You know, you come from nothing - you're going back to nothing.
    What have you lost? Nothing!)
    Always look on the right side of life...

Uitvoer:

paragrafen: 8
regels: 49
woorden: 307
karakters: 1571
letters: 1149
witruimte: 332
overige: 90

Added by:Peter Dawyndt
Date:2011-08-04
Time limit:10s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:PY_NBC
Resource:None

© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.