#!perl -p $_ x=$_<1;0while s/ABB/B/g