Function that returns count of substrings divisible by 8 but not by 3
static int count ( String s , int len ) { int MAX = 1000 ; int cur = 0 , dig = 0 ; int [ ] sum = new int [ MAX ] ; int [ , ] dp = new int [ MAX , 3 ] ; dp [ 0 , 0 ] = 1 ;