function tot=countm(n)
t=2^(n^2)-1;
tot=0;
for i0=0:t
  for i1=i0:t
    for i2=i1:t
      for i3=i2:t
        tot=tot+1;
      end
    end
  end
end
