All problems

The Impossible Ages

easyPythonData CleaningFiltering

Ashwell Health Trust collected patient ages through an online form that never checked what it was given, so the column now holds negative numbers where somebody typed a stray minus and numbers in the hundreds where somebody typed a year of birth. An age from 0 to 120 is treated as genuine, with both ends counting as valid; anything outside is dropped. The audit wants both numbers, because losing rows quietly is how a dataset goes wrong without anyone noticing.

Task: Print how many ages were kept and how many were dropped.

Input

The first line holds one integer n, how many ages follow. Each of the next n lines holds one age as a whole number, which may be negative or absurdly large. An age of exactly 0 and an age of exactly 120 are both valid.

Output

Two lines, kept first. The first reads kept, one space, then how many ages were inside the range. The second reads dropped, one space, then how many fell outside it. Both labels are lowercase.

Example:

Input:
5
34
-2
200
57
99

Output:
kept 3
dropped 2

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…