how to count window panes grid inside