if len(A) == len(set(A)):

return (len(A)*(len(A)+1))/2

```
A = sorted(A)
cho = 1
total = 1
for i in range(1,len(A)):
if A[i] == A[i-1]:
total+=cho
else:
cho+=1
total+=cho
return total
```