#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int64_t N;
  int64_t count=0;
  cin>>N;
  vector<int>data(200);
  for(int i=0;i<N;i++){
    int64_t a,z;
   cin>>a;
   z=a%200;
   data.at(z)++; 
  }
  for(int i=0;i<200;i++){
   int64_t b,c;
   b=data.at(i);
   c=(b*(b-1))/2; 
   count+=c;
   
 }
 cout<<count; 
}  
#include "bits/stdc++.h"
#pragma region header
using i32 = int;
using i64 = long long int;
using u32 = unsigned int;
using u64 = unsigned long long int;
using isize = ptrdiff_t;
using usize = size_t;

inline u64 popcount(const u64 v) {
#ifdef _MSC_VER
  return u64(__popcnt64(v));
#else
  return u64(__builtin_popcount(v));
#endif
}

class range {
  struct range_iterator {
    usize itr;
    constexpr range_iterator(const usize pos) noexcept : itr(pos) {}
    constexpr void operator++() noexcept { ++itr; }
    constexpr bool operator!=(const range_iterator& other) const noexcept {
      return itr != other.itr;
    }
    constexpr usize operator*() const noexcept { return itr; }
  };
  const range_iterator first, last;

 public:
  constexpr range(const usize first_, const usize last_) noexcept
      : first(first_), last(last_) {}
  constexpr range_iterator begin() const noexcept { return first; }
  constexpr range_iterator end() const noexcept { return last; }
};

template <class F>
class rec_lambda {
  F f;

 public:
  constexpr rec_lambda(F&& f_) : f(std::forward<F>(f_)) {}
  template <class... Args>
  constexpr auto operator()(Args&&... args) const {
    return f(*this, std::forward<Args>(args)...);
  }
};

namespace cs_helper {
void zip_sort_renumber([[maybe_unused]] std::vector<usize>& order) {}
template <class T, class... Args>
void zip_sort_renumber(std::vector<usize>& order, std::vector<T>& head,
                       Args&&... args) {
  usize n = order.size();
  assert(n == head.size());
  std::vector<T> sorted_head(n);
  for (usize i = 0; i < n; ++i) sorted_head[i] = head[order[i]];
  head = std::move(sorted_head);
  zip_sort_renumber(order, args...);
}
}  // namespace cs_helper

template <class T, class... Args>
std::vector<usize> zip_sort(std::vector<T>& head, Args&&... args) {
  usize n = head.size();
  std::vector<std::pair<T, usize>> tmp(n);
  for (usize i = 0; i < n; ++i) tmp[i] = std::make_pair(head[i], i);
  std::sort(tmp.begin(), tmp.end());
  std::vector<usize> order(n);
  for (usize i = 0; i < n; ++i) order[i] = tmp[i].second;
  cs_helper::zip_sort_renumber(order, head, args...);
  return order;
}
#pragma endregion

void main_() {
  int N;
  std::cin >> N;
  std::array<u64, 200> cnt;
  for (auto& el : cnt) el = 0;
  for (usize i : range(0, N)) {
    usize A;
    std::cin >> A;
    --A;
    ++cnt[A % 200];
  }
  u64 ans = 0;
  for (usize i : range(0, 200)) ans += cnt[i] * (cnt[i] - 1) / 2;
  std::cout << ans << '\n';
  /* ----- ----- 08.05.2021 ----- ----- */
}

int main() { main_(); }