number of (a,b,c,d,e,f) tuples satisfying a relation in a set