Given n products labeled 1..n and a list of [u, v] friendship edges, find all triangles (groups of 3 mutually connected products) and return the minimum sum of (degree(a) + degree(b) + degree(c) - 6) across all triangles. Return -1 if no triangle exists.