public int getNumber(String S) {
		char[] cs = S.toCharArray();
		int max = 0;
		int current = 1;
		for (int i = 1; i < cs.length; i++) {
			if (cs[i - 1] != cs[i]) {
				max = Math.max(max, current);
				current = 1;
			} else {
				current++;
			}
		}
		max = Math.max(max, current);

		return S.length() - max;

	}