int readInt () {
        int ch;
        int assembly=0;
        try {
            ch = in.read();
            while(ch==' ' || ch=='\n' || ch=='\r') {
                ch = in.read();
            }
            if (ch == '-') {
                return -readInt();
            }
            while(ch>='0' && ch<='9') {
                assembly = assembly * 10 + (ch - '0');
                ch = in.read();
            }
        } catch (IOException e) {};
        return assembly;
    }