fork download
  1. # your code goes here
  2. n=int(input())
  3. arr=list(map(int, input().split()))
  4. ctr=0
  5. mp={}
  6. for x in arr:
  7. real=x%5
  8. r=(5-real)%5
  9. ctr+=mp.get(r, 0)
  10. mp[real]=mp.get(real, 0)+1
  11. print(ctr)
Success #stdin #stdout 0.1s 14060KB
stdin
6
2 2 5 5 3 3
stdout
5