Extracting the first number after ']' in R : I would like to extract the first number after ']' in a character vector

> dput(dense[1:8])
c("   481 denseSlack[0,SMITH]", "                                   0             0               ", 
"   482 denseSlack[0,JOHNSON]", "                                   1             0               ", 
"   483 denseSlack[0,WILLIAMS]", "                                   0             0               ", 
"   484 denseSlack[0,JONES]", "                                   1             0               "
)

The output should be a vector (0,1,0,1).

How can I do this in R?