public int getCount(int maxR, int maxG, int maxB, int startR, int startG, int startB, int d1, int d2){
        int ret =0;
        for (int i = 0 ; i < maxR; i++) 
        for (int j = 0; j < maxG; j++)
        for (int k = 0; k < maxB; k++)
        {
            boolean a=(Math.abs(i-startR)<=d2);
            boolean b=(Math.abs(j-startG)<=d2);
            boolean c = (Math.abs(k-startB)<=d2 );
            boolean d =  Math.abs(i-startR)>=d1;
            boolean e = Math.abs(j-startG)>=d1;
            boolean f = Math.abs(k-startB)>=d1;
            if(a&&b&&c&&(e||d||f)){
                ret++;
                //System.out.println(i+","+j+","+k);
            }
            
        }
        return ret;
    }