private static int countSpace(String s){
        int t=0;
        for(int i=0; i < s.length(); i++) {
            if(s.charAt(i) == ' ') {
                t++;
                if ((i>0)&&(s.charAt(i-1)==' ')){
                    t--;
                }//count result from "asd asdsd         asdasd" must be 2
            }
        }
        return t;
    }