Neighbours count to a function