const rl = require("readline").createInterface({ input: process.stdin });
var iter = rl[Symbol.asyncIterator]();
const readline = async () => (await iter.next()).value;

void async function () {
  let line = String(await readline());
  let head = line.substring(0,line.length/2);
  let foot = line.substring(line.length/2);
  function getTimes(s){
    let o={},max=1;
    for(let i=0;i<s.length;i++){
      if(o[s[i]]){
        o[s[i]]++;
      }else{
        o[s[i]]=1;
      }
    }
    for(const k in o){
      max=max<o[k]?o[k]:max;
    }
    return max;
  }
  console.log(line.length-getTimes(head)-getTimes(foot));
}()

利用对象统计字符串的出现次数,从而推算出最小的修改次数。