Try this formula

=SUM(IF(FREQUENCY(IF(A1:A50<>"",MATCH(A1:A50,A1:A50,0)),ROW(A1:A50)-ROW(A1)+1)>=3,1))

confirmed with CTRL+SHIFT+ENTER