counting a subset of paths through 2d grid