How to count the number of co-prime pairs in a given array?

Question:-
Write a function that takes array size and array as the input and returns the number of co-prime pairs as output.

input array- 7, 4, 3, 6, 9

co-prime pairs- (7,4) (7,3) (7,6) (7,9) (4,3) (4,9)

output- 6