All problems

Counting Values in the Tails

mediumPythonMatplotlibHistogram

Bramley Foods asks Ashgrove Analytics to flag odd days in its till takings. Finance already has a rule it trusts: a day is odd when it sits more than two spreads away from the average day, where a spread is the standard deviation of the takings. The banded picture makes far-out days easy to point at in a meeting, but the report needs the count itself written underneath.

Task: Print how many days sit more than two spreads away from the average, counting unusually quiet days as well as unusually busy ones. Work the spread out over the whole list you are handed, treating it as the entire population rather than as a sample of something larger. A day sitting exactly two spreads out is not more than two spreads out and does not count.

Input

The first line holds an integer n, the number of days. Each of the next n lines holds one day's takings, possibly with decimals. n is at least 1.

Output

One line holding a whole number: how many days are flagged.

Example:

Input:
6
10
11
9
12
10
100

Output:
1

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…