import Data.List
import qualified Data.Set as Set
main=interact $ show.maximum.f.lines
f (n:s:_) = map (Set.size.g.flip splitAt s) [1..(read n)]
g (a,b) = Set.intersection (Set.fromList a) (Set.fromList b)