6 kyu

Count words

Description:

Kate likes to count words in text blocks. By words she means continuous sequences of English alphabetic characters (from a to z ). Here are examples:

Hello there, little user5453 374 ())$. I’d been using my sphere as a stool. Slow-moving target 839342 was hit by OMGd-63 or K4mp. contains "words" ['Hello', 'there', 'little', 'user', 'I', 'd', 'been', 'using', 'my','sphere', 'as', 'a', 'stool', 'Slow', 'moving', 'target', 'was', 'hit', 'by', 'OMGd', 'or', 'K', 'mp']

Kate doesn't like some of words and doesn't count them. Words to be excluded are "a", "the", "on", "at", "of", "upon", "in" and "as", case-insensitive.

Today Kate's too lazy and have decided to teach her computer to count "words" for her.

Example Input 1

Hello there, little user5453 374 ())$.

Example Output 1

4

Example Input 2

I’d been using my sphere as a stool. I traced counterclockwise circles on it with my fingertips and it shrank until I could palm it. My bolt had shifted while I’d been sitting. I pulled it up and yanked the pleats straight as I careered around tables, chairs, globes, and slow-moving fraas. I passed under a stone arch into the Scriptorium. The place smelled richly of ink. Maybe it was because an ancient fraa and his two fids were copying out books there. But I wondered how long it would take to stop smelling that way if no one ever used it at all; a lot of ink had been spent there, and the wet smell of it must be deep into everything.

Example Output 2

112

Strings
Regular Expressions
Fundamentals

Stats:

CreatedFeb 4, 2016
PublishedFeb 4, 2016
Warriors Trained2305
Total Skips50
Total Code Submissions7311
Total Times Completed899
Python Completions564
JavaScript Completions353
Total Stars38
% of votes with a positive feedback rating88% of 226
Total "Very Satisfied" Votes182
Total "Somewhat Satisfied" Votes33
Total "Not Satisfied" Votes11
Ad
Contributors
  • eugene-katsevman Avatar
  • suic Avatar
  • kazk Avatar
  • rowcased Avatar
  • farhanaditya Avatar
Ad