read s k&&. ./* $[!k?w=h,h=n,n=s:h*(x+=!s[s]++)+w*(y+=!k[k]++)-x*y-n]||echo $2