SELECT
t1.*
, count(t2.id) AS count
FROM
table AS t1
INNER JOIN
table AS t2 on t1.id = t2.parent
INNER JOIN
table AS t3 on t2.id = t3.parent
INNER JOIN
table AS t4 on t3.id = t4.parent
INNER JOIN
table AS t5 on t4.id = t5.parent
INNER JOIN
table AS t6 on t5.id = t6.parent
WHERE
t1.parent IS NULL
GROUP BY
t1.id
HAVING
count(t2.id) >= 3