Number of adjacent mines

It doesn't quite work but it almost works.