public static void reduce(String str) {
		char[] buff = str.toCharArray();
		boolean keepGoing = true;
		while (keepGoing) {
			keepGoing = false;
			int start = -1;
			int end = -1;
			for (int i = 0; i < buff.length; i++) {
				if (buff[i] == 0)
					continue;
				if (start == -1) {
					start = i;
					continue;
				}
				if (end == -1) {
					end = i;
					if (buff[start] == buff[end]) {
						start = end;
						end = -1;
						continue;
					}
					char temp = changeToMake(buff[start], buff[end]);
					buff[start] = temp;
					buff[end] = 0;

					end = -1;
					keepGoing = true;

				}

			}
		}

		StringBuilder strbuilder = new StringBuilder();

		for (int i = 0; i < buff.length; i++) {
			if (buff[i] != 0)
				strbuilder.append(buff[i]);
		}
		System.out.println(strbuilder.toString().length());

	}