I have an algorithm whose usability will depend on the language that you are using.
I am writing my answer in reference to C++.
So if the entries of the array is strictly less than 1,000,000 then you can use my idea.So here it goes:
The basic idea is to store the tuple of 3 numbers(say a,b and c in order) as k=10^12*a+10^6*b+c.
So every unique k will be a unique tuple which you can get by
a = k/10^12
b = (k/10^6)%10^6
c = k%10^6
So for example a=123 ,b=58469 and c=12 then k = 123058469000012
and a,b,c can be recovered as k/10^12 = 123,(k/10^6)%10^6=058469 and k%10^6=000012
For getting k you can iterate the array in three nested loops.
For counting unique k's you can use any data structures like map,set etc. depending on your programming language.
If elements are larger you can simply iterate through the array in three nested loops and store the numbers in say std::pair< long long , pair < long long ,long long > > (a data structure in C++) and then you can use again data structures like set,map etc. to count unique pairs.
P.S. : I didn't write code because there was no language specified but hope my idea helps.