Imports System.Collections.Generic
Imports System.Console

Module Program
    Sub Main()
        Dim N As Integer = NextInt()
        Dim S As String = ReadLine()

        Dim ans As Integer

        For i As Integer = 1 To N
            Dim X As String = Mid(S, 1, i)
            Dim Y As String = Mid(S, i + 1)
            Dim cnt As Integer = 0
            For j As Integer = Asc("a") To Asc("z")
                Dim c As Char = Chr(j)
                If X.Contains(c) AndAlso Y.Contains(c) Then cnt += 1
            Next
            ans = Math.Max(ans, cnt)
        Next

        WriteLine(ans)
    End Sub

    Function NextInt() As Integer
        Return CInt(NextString())
    End Function

    Function NextString() As String
        Dim result As New List(Of Char)
        Do
            Dim tmp As Integer = Read()
            If tmp < 0 Then Exit Do
            Dim nextChar As Char = Chr(tmp)

            If Not Char.IsWhiteSpace(nextChar) Then
                result.Add(nextChar)
            ElseIf nextChar <> vbCr Then
                Exit Do
            End If
        Loop
        Return New String(result.ToArray())
    End Function

End Module
