Problems
Every day, as part of her walk around the farm, Bessie the cow visits her favorite pasture, which has
As a budding photographer, Bessie decides to take several photos of these flowers. In particular, for every pair of flowers
Bessie later looks at these photos and notices that some of these photos have an "average flower" -- a flower that has
How many of Bessie's photos have an average flower?
Input
The first line of input contains
Output
Please print out the number of photos that have an average flower.
Example #1
4
1 1 2 3
6
Every picture containing just a single flower contributes to the count (there are four of these in the example). Also, the
Example #2
12
7 2 3 8 5 9 1 4 1 5 9 10
22