here it is:
BEGIN {bar="";cnt=0;hdr=1}
{
if($1==bar)
{stuff[++cnt]=$0}
else
{if(NR==1)
{stuff[++cnt]=$0}}
}
{
if($1!=bar)
if(cnt>2) if(NR>1) {print bar,cnt >> "clms";tcnt=tcnt+cnt}}
else
{if(NR>1) {for(r in stuff) print stuff[r] >> "dummy"}}
}
{
if($1!=bar)
{if(NR>1) {for(r in stuff) delete stuff[r];cnt=1;stuff[cnt]=$0}}
}
{bar=$1}
END{
if(cnt>2) print bar,cnt " lines." >> "clms";
else for(r in stuff) print stuff[r] >> "dummy"
}