C, 12x8 = 96
Inspired by @ciamej, I've reduced it. It uses that divide by 3 trick, plus the realization that the carpet effectively converts an if into a while loop.
The code was tested on gcc/Ubuntu for iterations up to 3.
#ifndef A //
#define A //
x;main(a){//
a++;/* */
if(a/=3)x++;
printf( //
"%d",x);} //
#endif //
Previous Solution: C, 11x12
Not a size winner, but hey, it's C.
It finds log2 of the blockcount by bitshifting, then uses some magic numbers and int truncation to estimate log3. The math should work up to 26 iterations (a 42 bit number).
#ifndef A//
#define A//
int n=0;//_
int main//_
(v,c){//___
n+=1;/*..*/
while(n//__
>>=1)v++;//
n=.3+.62*v;
printf(//__
"%d",n);}//
#endif//__