Daisy Chains
Every day, as part of her walk around the farm, Bessie the cow visits her favorite pasture, which has flowers (all colorful daisies) labeled lined up in a row. Flower has petals.
As a budding photographer, Bessie decides to take several photos of these flowers. In particular, for every pair of flowers satisfying , Bessie takes a photo of all flowers from flower to flower (including and ).
Bessie later looks at these photos and notices that some of these photos have an "average flower" — a flower that has petals, where is the exact average number of petals among all flowers in the photo.
How many of Bessie's photos have an average flower?
Input
The first line contains . The second line contains integers .
Output
Please print out the number of photos that have an average flower.
Examples
Note
Every picture containing just a single flower contributes to the count (there are four of these in the example). Also, the ranges and in this example correspond to pictures that have an average flower.