const main = stdin => {
  const input = stdin.trim().split('\n')
  const N = parseInt(input[0])
  const S = input[1]

  let max = 0
  for (let i = 0; i < N; i++) {
    const leftMemo = []
    for (let j = 0; j <= i; j++) {
      leftMemo.push(S[j])
    }
    const rightMemo = []
    for (let j = i + 1; j < N; j++) {
      rightMemo.push(S[j])
    }

    const productSet = leftMemo.filter(val => rightMemo.includes(val))

    const uniqueSet = new Set(productSet)
    max = Math.max(max, uniqueSet.size)
  }

  console.log(max)
}


// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))
