const getUnique = (arr) =>
  arr.filter((value, index, self) => self.indexOf(value) === index);

function Main (input) {
  const strArr = input.split(/\s/g)[1].split('');
  const strLength = strArr.length;
  var counter = 0;

  const results = new Array(strLength).fill('').map((value, index) => {
    if (index === 0) return 0;

    const right = [...strArr]
    const left = right.splice(index);
    const uniqueRight = getUnique(right);
    const uniqueLeft = getUnique(left);
    
    const result = uniqueRight.filter((value) => uniqueLeft.indexOf(value) !== -1);
    return result ? result.length : 0
  });
  console.log('%s', Math.max(...results));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
