#include <bits/stdc++.h>
using namespace std;
class Pair;
class Item {
  friend ostream& operator<<(ostream& out, const Pair& c);
  friend istream& operator>>(istream& out, Pair& c);

 public:
  Item(string des) { description = des; }
  long long int keyF() {
    key = description.length();
    return key;
  }
  string toString() { return description; }
  long long int key;
  string description;
};
ostream& operator<<(ostream& out, const Item& c) {
  out << c.description;
  return out;
}
istream& operator>>(istream& in, Item& c) {
  in >> c.description;
  return in;
}
template <typename E>
void print(E value) {
  cout << value;
}
template <typename E>
void print(E value1, E value2) {
  cout << value1 << " " << value2;
}
template <typename E>
void print(E value1, E value2, E value3) {
  cout << value1 << " " << value2 << " " << value3;
}
template <typename E>
E read() {
  E value;
  cin >> value;
  return value;
}
string readString() {
  char* s = new char[1000];
  fgets(s, 1000, stdin);
  return string(s);
}
template <typename E>
void println(E value) {
  cout << value << endl;
}
template <typename E>
void println(E value1, E value2) {
  cout << value1 << " " << value2 << endl;
}
template <typename E>
void println(E value1, E value2, E value3) {
  cout << value1 << " " << value2 << " " << value3 << endl;
}
template <typename E>
void println(E value1, E value2, E value3, E value4) {
  cout << value1 << " " << value2 << " " << value3 << " " << value4 << endl;
}
long long int randomint(long long int min, long long int max) {
  if (max == min) {
    return max;
  }
  return rand() % (max - min + 1) + min;
}
class Pair {
  friend ostream& operator<<(ostream& out, const Pair& c);
  friend istream& operator>>(istream& out, Pair& c);

 public:
  Pair(Item* p);
  long long int key;
  Item* value;
};
Pair::Pair(Item* b) {
  key = b->key;
  value = b;
}
ostream& operator<<(ostream& out, const Pair& c) {
  out << "(" << c.value->key << " -> " << (c.value->toString()) << ")";
  return out;
}
template <typename E>
class Array {
 public:
  long long int size;
  Array<E>(long long int _capacity) {
    capacity = _capacity;
    array = new E[capacity];
    size = capacity;
    for (long long int i = 0; i < size; i++) {
      array[i] = 0;
    }
  }
  void sort() { std::sort(&array[0], &array[size]); }
  Array() {
    capacity = 0;
    array = new E[capacity];
    size = 0;
  }
  Array(vector<E>& vect) {
    long long int _size = vect.size();
    capacity = _size * 2;
    size = _size;
    array = new E[capacity];
    for (long long int i = 0; i < size; i++) {
      array[i] = vect[i];
    }
  }
  Array(long long int minBound, long long int maxBound, long long int _size) {
    srand(_size);
    capacity = _size * 2;
    size = _size;
    array = new E[capacity];
    for (long long int i = 0; i < size; i++) {
      array[i] = randomint(minBound, maxBound);
    }
  }
  void add(E item);
  vector<E> toVector();
  void toString();
  E& operator[](long long int i);
  E& index(long long int i);
  E* array;
  void null(void) {
    for (long long int i = 0; i < size; i++) {
      array[i] = 0;
    }
  }

 private:
  long long int capacity;
  void ensureCapacity(long long int cap);
};
template <typename E>
void Array<E>::ensureCapacity(long long int cap) {
  capacity = capacity * 2;
  E* newArray = new E[capacity];
  memcpy(newArray, array, sizeof(E) * size);
  delete[] array;
  array = newArray;
}
template <typename E>
void Array<E>::toString() {
  long long int i = 0;
  E* begin = array;
  cout << "[";
  while (i < size) {
    if (i == size - 1) {
      cout << *array;
    } else {
      cout << *array << " ";
    }
    array++;
    i++;
  }
  cout << "]";
  cout << endl;
  array = begin;
}
template <typename E>
void Array<E>::add(E item) {
  if (capacity < size + 1) {
    ensureCapacity(size + 1);
  }
  array[size] = item;
  size++;
}
template <typename E>
vector<E> Array<E>::toVector() {
  vector<E> res = vector<E>(size);
  for (long long int i = 0; i < res.size(); i++) {
    res[i] = array[i];
  }
  return res;
}
template <typename E>
E& Array<E>::operator[](long long int i) {
  if (i < size && i >= 0) {
    return array[i];
  } else {
    cout << "Array index out of bounds, index is " << i << ", size is " << size
         << endl;
    cout << "Array is " << endl;
    toString();
    assert(0);
  }
}
template <typename E>
class Matrix {
 public:
  long long int rows;
  long long int columns;
  Array<E> array;
  E& get(long long int x, long long int y);
  void set(long long int x, long long int y, E& value);
  void print();
  Matrix<E>(long long int _rows, long long int _columns) {
    rows = _rows;
    columns = _columns;
    array = Array<E>(rows * columns);
    array.null();
    long long int l = 0;
  }
  void swap(Matrix<E>& other) {
    std::swap(array, other.array);
    std::swap(rows, other.rows);
    std::swap(columns, other.columns);
  }
  Matrix<E>& operator=(Matrix<E> other) {
    swap(other);
    return *this;
  }
  Matrix<E>(long long int minBound, long long int maxBound, long long int _rows,
            long long int _columns) {
    rows = _rows;
    columns = _columns;
    long long int size = _rows * _columns;
    array = Array<E>(minBound, maxBound, size);
  }

 private:
};
template <typename E>
E& Matrix<E>::get(long long int x, long long int y) {
  if (x >= columns || x < 0) {
    assert(0);
  }
  if (y >= rows || y < 0) {
    assert(0);
  }
  return array.array[x + y * columns];
}
template <typename E>
void Matrix<E>::print(void) {
  for (size_t y = 0; y < rows; y++) {
    for (size_t x = 0; x < columns; x++) {
      long long int index = x + y * columns;
      cout << array.array[x + y * columns] << " ";
    }
    cout << endl;
  }
}
template <typename E>
void Matrix<E>::set(long long int x, long long int y, E& value) {
  if (x >= columns || x < 0) {
    assert(0);
  }
  if (y >= rows || y < 0) {
    assert(0);
  }
  array.array[x + y * columns] = value;
}
long long int bpow(long long int a, long long int b) {
  if (b == 0) {
    return 1;
  } else {
    if (b % 2 == 0) {
      long long int half = bpow(a, b / 2);
      return half * half;
    } else {
      return bpow(a, b - 1) * a;
    }
  }
}
long long int gcd(long long int a, long long int b) {
  if (!b) {
    return a;
  } else {
    return gcd(b, a % b);
  }
}
vector<pair<long long int, long long int> > factorize(long long int n) {
  vector<pair<long long int, long long int> > res =
      vector<pair<long long int, long long int> >();
  for (long long int i = 2; i < sqrt((double)n) + 1; i++) {
    if (n % i == 0) {
      pair<long long int, long long int> comp = make_pair(i, 1);
      n /= i;
      while (n % i == 0) {
        comp.second++;
        n /= i;
      }
      res.push_back(comp);
    }
  }
  if (n > 1) {
    res.push_back(make_pair(n, 1));
  }
  return res;
}
long long int euler(long long int n) {
  vector<pair<long long int, long long int> > fact = factorize(n);
  long long int res = 1;
  for (unsigned long long int i = 0; i < fact.size(); i++) {
    long long int factor =
        pow((double)fact[i].first, (double)fact[i].second) -
        pow((double)fact[i].first, (double)fact[i].second - 1);
    res *= factor;
  }
  return res;
}
long long int inversePrime(long long int a, long long int m) {
  return bpow(a, m - 2) % m;
}
long long int inverseCoprimes(long long int a, long long int m) {
  return bpow(a, euler(m) - 1) % m;
}
long long int inverse(long long int a, long long int m) {
  if (gcd(a, m) == 1) {
    return inverseCoprimes(a, m);
  } else {
    assert(0);
    return -1;
  }
}
vector<long long int> enumerateDivisors(long long int n) {
  vector<pair<long long int, long long int> > divs = factorize(n);
  vector<long long int> totals = vector<long long int>(divs.size() + 1);
  totals[0] = 1;
  for (unsigned long long int i = 1; i < divs.size() + 1; i++) {
    totals[i] = totals[i - 1] * (divs[i - 1].second + 1);
  }
  vector<long long int> res = vector<long long int>();
  for (long long int i = 0; i < totals[totals.size() - 1]; i++) {
    vector<long long int> values = vector<long long int>(divs.size());
    for (unsigned long long int j = 0; j < values.size(); j++) {
      values[j] = (i / totals[j]) % (divs[j].second + 1);
    }
    long long int r = 1;
    for (unsigned long long int i = 0; i < values.size(); i++) {
      r *= pow((double)divs[i].first, (double)values[i]);
    }
    res.push_back(r);
  }
  return res;
}
istream& operator>>(istream& in, Pair& c) {
  in >> c.value->description;
  c.value->key = c.value->keyF();
  return in;
}
void reverse(char* str) {
  char temp;
  size_t len = strlen(str) - 1;
  size_t i;
  size_t k = len;
  for (i = 0; i < len; i++) {
    temp = str[k];
    str[k] = str[i];
    str[i] = temp;
    k--;
    if (k == (len / 2)) {
      break;
    }
  }
}
map<long long int, long long int> count(Array<long long int> a) {
  map<long long int, long long int> res;
  for (unsigned long long int i = 0; i < a.size; i++) {
    res[a[i]]++;
  }
  return res;
}
void itoa(long long int n, char s[]) {
  long long int i, sign;
  if ((sign = n) < 0) n = -n;
  i = 0;
  do {
    s[i++] = n % 10 + '0';
  } while ((n /= 10) > 0);
  if (sign < 0) s[i++] = '-';
  s[i] = '\0';
  reverse(s);
}
long long int* vectorToArray(vector<long long int> v) {
  long long int* a = new long long int[v.size()];
  for (unsigned long long int i = 0; i < v.size(); i++) {
    a[i] = v[i];
  }
  return a;
}
int main(void) {
  long long int n = 5;
  cin >> n;
  Array<long long int> a(n);
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  map<long long int, long long int> m = count(a);
  map<long long int, long long int>::iterator it = m.begin();
  long long int total = 0;
  long long int del = 0;
  while (it != m.end()) {
    map<long long int, long long int>::iterator jt = m.begin();
    while (jt != m.end()) {
      pair<long long int, long long int> entry1 = *it;
      pair<long long int, long long int> entry2 = *jt;
      if (entry1.first == -entry2.first) {
        if (entry1.first == 0) {
          total += entry1.second * (entry1.second - 1) / 2;
        } else {
          total += entry1.second * (entry2.second);
          del += entry1.second * (entry2.second);
        }
      }
      jt++;
    }
    it++;
  }
  total -= del / 2;
  println(total);
}

### Prompt

Please provide a CPP coded solution to the problem described below:

Everybody knows that opposites attract. That is the key principle of the "Perfect Matching" dating agency. The "Perfect Matching" matchmakers have classified each registered customer by his interests and assigned to the i-th client number ti ( - 10 ≤ ti ≤ 10). Of course, one number can be assigned to any number of customers.

"Perfect Matching" wants to advertise its services and publish the number of opposite couples, that is, the couples who have opposite values of t. Each couple consists of exactly two clients. The customer can be included in a couple an arbitrary number of times. Help the agency and write the program that will find the sought number by the given sequence t1, t2, ..., tn. For example, if t = (1, - 1, 1, - 1), then any two elements ti and tj form a couple if i and j have different parity. Consequently, in this case the sought number equals 4.

Of course, a client can't form a couple with him/herself.

Input

The first line of the input data contains an integer n (1 ≤ n ≤ 105) which represents the number of registered clients of the "Couple Matching". The second line contains a sequence of integers t1, t2, ..., tn ( - 10 ≤ ti ≤ 10), ti — is the parameter of the i-th customer that has been assigned to the customer by the result of the analysis of his interests.

Output

Print the number of couples of customs with opposite t. The opposite number for x is number  - x (0 is opposite to itself). Couples that only differ in the clients' order are considered the same.

Note that the answer to the problem can be large enough, so you must use the 64-bit integer type for calculations. Please, do not use the %lld specificator to read or write 64-bit integers in С++. It is preferred to use cin, cout streams or the %I64d specificator.

Examples

Input

5
-3 3 0 0 3


Output

3


Input

3
0 0 0


Output

3

Note

In the first sample the couples of opposite clients are: (1,2), (1,5) и (3,4).

In the second sample any couple of clients is opposite.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
class Pair;
class Item {
  friend ostream& operator<<(ostream& out, const Pair& c);
  friend istream& operator>>(istream& out, Pair& c);

 public:
  Item(string des) { description = des; }
  long long int keyF() {
    key = description.length();
    return key;
  }
  string toString() { return description; }
  long long int key;
  string description;
};
ostream& operator<<(ostream& out, const Item& c) {
  out << c.description;
  return out;
}
istream& operator>>(istream& in, Item& c) {
  in >> c.description;
  return in;
}
template <typename E>
void print(E value) {
  cout << value;
}
template <typename E>
void print(E value1, E value2) {
  cout << value1 << " " << value2;
}
template <typename E>
void print(E value1, E value2, E value3) {
  cout << value1 << " " << value2 << " " << value3;
}
template <typename E>
E read() {
  E value;
  cin >> value;
  return value;
}
string readString() {
  char* s = new char[1000];
  fgets(s, 1000, stdin);
  return string(s);
}
template <typename E>
void println(E value) {
  cout << value << endl;
}
template <typename E>
void println(E value1, E value2) {
  cout << value1 << " " << value2 << endl;
}
template <typename E>
void println(E value1, E value2, E value3) {
  cout << value1 << " " << value2 << " " << value3 << endl;
}
template <typename E>
void println(E value1, E value2, E value3, E value4) {
  cout << value1 << " " << value2 << " " << value3 << " " << value4 << endl;
}
long long int randomint(long long int min, long long int max) {
  if (max == min) {
    return max;
  }
  return rand() % (max - min + 1) + min;
}
class Pair {
  friend ostream& operator<<(ostream& out, const Pair& c);
  friend istream& operator>>(istream& out, Pair& c);

 public:
  Pair(Item* p);
  long long int key;
  Item* value;
};
Pair::Pair(Item* b) {
  key = b->key;
  value = b;
}
ostream& operator<<(ostream& out, const Pair& c) {
  out << "(" << c.value->key << " -> " << (c.value->toString()) << ")";
  return out;
}
template <typename E>
class Array {
 public:
  long long int size;
  Array<E>(long long int _capacity) {
    capacity = _capacity;
    array = new E[capacity];
    size = capacity;
    for (long long int i = 0; i < size; i++) {
      array[i] = 0;
    }
  }
  void sort() { std::sort(&array[0], &array[size]); }
  Array() {
    capacity = 0;
    array = new E[capacity];
    size = 0;
  }
  Array(vector<E>& vect) {
    long long int _size = vect.size();
    capacity = _size * 2;
    size = _size;
    array = new E[capacity];
    for (long long int i = 0; i < size; i++) {
      array[i] = vect[i];
    }
  }
  Array(long long int minBound, long long int maxBound, long long int _size) {
    srand(_size);
    capacity = _size * 2;
    size = _size;
    array = new E[capacity];
    for (long long int i = 0; i < size; i++) {
      array[i] = randomint(minBound, maxBound);
    }
  }
  void add(E item);
  vector<E> toVector();
  void toString();
  E& operator[](long long int i);
  E& index(long long int i);
  E* array;
  void null(void) {
    for (long long int i = 0; i < size; i++) {
      array[i] = 0;
    }
  }

 private:
  long long int capacity;
  void ensureCapacity(long long int cap);
};
template <typename E>
void Array<E>::ensureCapacity(long long int cap) {
  capacity = capacity * 2;
  E* newArray = new E[capacity];
  memcpy(newArray, array, sizeof(E) * size);
  delete[] array;
  array = newArray;
}
template <typename E>
void Array<E>::toString() {
  long long int i = 0;
  E* begin = array;
  cout << "[";
  while (i < size) {
    if (i == size - 1) {
      cout << *array;
    } else {
      cout << *array << " ";
    }
    array++;
    i++;
  }
  cout << "]";
  cout << endl;
  array = begin;
}
template <typename E>
void Array<E>::add(E item) {
  if (capacity < size + 1) {
    ensureCapacity(size + 1);
  }
  array[size] = item;
  size++;
}
template <typename E>
vector<E> Array<E>::toVector() {
  vector<E> res = vector<E>(size);
  for (long long int i = 0; i < res.size(); i++) {
    res[i] = array[i];
  }
  return res;
}
template <typename E>
E& Array<E>::operator[](long long int i) {
  if (i < size && i >= 0) {
    return array[i];
  } else {
    cout << "Array index out of bounds, index is " << i << ", size is " << size
         << endl;
    cout << "Array is " << endl;
    toString();
    assert(0);
  }
}
template <typename E>
class Matrix {
 public:
  long long int rows;
  long long int columns;
  Array<E> array;
  E& get(long long int x, long long int y);
  void set(long long int x, long long int y, E& value);
  void print();
  Matrix<E>(long long int _rows, long long int _columns) {
    rows = _rows;
    columns = _columns;
    array = Array<E>(rows * columns);
    array.null();
    long long int l = 0;
  }
  void swap(Matrix<E>& other) {
    std::swap(array, other.array);
    std::swap(rows, other.rows);
    std::swap(columns, other.columns);
  }
  Matrix<E>& operator=(Matrix<E> other) {
    swap(other);
    return *this;
  }
  Matrix<E>(long long int minBound, long long int maxBound, long long int _rows,
            long long int _columns) {
    rows = _rows;
    columns = _columns;
    long long int size = _rows * _columns;
    array = Array<E>(minBound, maxBound, size);
  }

 private:
};
template <typename E>
E& Matrix<E>::get(long long int x, long long int y) {
  if (x >= columns || x < 0) {
    assert(0);
  }
  if (y >= rows || y < 0) {
    assert(0);
  }
  return array.array[x + y * columns];
}
template <typename E>
void Matrix<E>::print(void) {
  for (size_t y = 0; y < rows; y++) {
    for (size_t x = 0; x < columns; x++) {
      long long int index = x + y * columns;
      cout << array.array[x + y * columns] << " ";
    }
    cout << endl;
  }
}
template <typename E>
void Matrix<E>::set(long long int x, long long int y, E& value) {
  if (x >= columns || x < 0) {
    assert(0);
  }
  if (y >= rows || y < 0) {
    assert(0);
  }
  array.array[x + y * columns] = value;
}
long long int bpow(long long int a, long long int b) {
  if (b == 0) {
    return 1;
  } else {
    if (b % 2 == 0) {
      long long int half = bpow(a, b / 2);
      return half * half;
    } else {
      return bpow(a, b - 1) * a;
    }
  }
}
long long int gcd(long long int a, long long int b) {
  if (!b) {
    return a;
  } else {
    return gcd(b, a % b);
  }
}
vector<pair<long long int, long long int> > factorize(long long int n) {
  vector<pair<long long int, long long int> > res =
      vector<pair<long long int, long long int> >();
  for (long long int i = 2; i < sqrt((double)n) + 1; i++) {
    if (n % i == 0) {
      pair<long long int, long long int> comp = make_pair(i, 1);
      n /= i;
      while (n % i == 0) {
        comp.second++;
        n /= i;
      }
      res.push_back(comp);
    }
  }
  if (n > 1) {
    res.push_back(make_pair(n, 1));
  }
  return res;
}
long long int euler(long long int n) {
  vector<pair<long long int, long long int> > fact = factorize(n);
  long long int res = 1;
  for (unsigned long long int i = 0; i < fact.size(); i++) {
    long long int factor =
        pow((double)fact[i].first, (double)fact[i].second) -
        pow((double)fact[i].first, (double)fact[i].second - 1);
    res *= factor;
  }
  return res;
}
long long int inversePrime(long long int a, long long int m) {
  return bpow(a, m - 2) % m;
}
long long int inverseCoprimes(long long int a, long long int m) {
  return bpow(a, euler(m) - 1) % m;
}
long long int inverse(long long int a, long long int m) {
  if (gcd(a, m) == 1) {
    return inverseCoprimes(a, m);
  } else {
    assert(0);
    return -1;
  }
}
vector<long long int> enumerateDivisors(long long int n) {
  vector<pair<long long int, long long int> > divs = factorize(n);
  vector<long long int> totals = vector<long long int>(divs.size() + 1);
  totals[0] = 1;
  for (unsigned long long int i = 1; i < divs.size() + 1; i++) {
    totals[i] = totals[i - 1] * (divs[i - 1].second + 1);
  }
  vector<long long int> res = vector<long long int>();
  for (long long int i = 0; i < totals[totals.size() - 1]; i++) {
    vector<long long int> values = vector<long long int>(divs.size());
    for (unsigned long long int j = 0; j < values.size(); j++) {
      values[j] = (i / totals[j]) % (divs[j].second + 1);
    }
    long long int r = 1;
    for (unsigned long long int i = 0; i < values.size(); i++) {
      r *= pow((double)divs[i].first, (double)values[i]);
    }
    res.push_back(r);
  }
  return res;
}
istream& operator>>(istream& in, Pair& c) {
  in >> c.value->description;
  c.value->key = c.value->keyF();
  return in;
}
void reverse(char* str) {
  char temp;
  size_t len = strlen(str) - 1;
  size_t i;
  size_t k = len;
  for (i = 0; i < len; i++) {
    temp = str[k];
    str[k] = str[i];
    str[i] = temp;
    k--;
    if (k == (len / 2)) {
      break;
    }
  }
}
map<long long int, long long int> count(Array<long long int> a) {
  map<long long int, long long int> res;
  for (unsigned long long int i = 0; i < a.size; i++) {
    res[a[i]]++;
  }
  return res;
}
void itoa(long long int n, char s[]) {
  long long int i, sign;
  if ((sign = n) < 0) n = -n;
  i = 0;
  do {
    s[i++] = n % 10 + '0';
  } while ((n /= 10) > 0);
  if (sign < 0) s[i++] = '-';
  s[i] = '\0';
  reverse(s);
}
long long int* vectorToArray(vector<long long int> v) {
  long long int* a = new long long int[v.size()];
  for (unsigned long long int i = 0; i < v.size(); i++) {
    a[i] = v[i];
  }
  return a;
}
int main(void) {
  long long int n = 5;
  cin >> n;
  Array<long long int> a(n);
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  map<long long int, long long int> m = count(a);
  map<long long int, long long int>::iterator it = m.begin();
  long long int total = 0;
  long long int del = 0;
  while (it != m.end()) {
    map<long long int, long long int>::iterator jt = m.begin();
    while (jt != m.end()) {
      pair<long long int, long long int> entry1 = *it;
      pair<long long int, long long int> entry2 = *jt;
      if (entry1.first == -entry2.first) {
        if (entry1.first == 0) {
          total += entry1.second * (entry1.second - 1) / 2;
        } else {
          total += entry1.second * (entry2.second);
          del += entry1.second * (entry2.second);
        }
      }
      jt++;
    }
    it++;
  }
  total -= del / 2;
  println(total);
}

```