Implemented below mentioned changes:

1. Created methods for different tasks.
2. Used regex so as not to include count of characters other than alphabets.
3. Indented the code by 2 spaces.
4. Used descriptive variable names.