import Data.List

toInt :: (String -> Int)
toInt x = read x ::Int

repStr s n = foldl (\x y -> x ++ s) "" [0..(n-1)]

f needle str n
  | (isInfixOf needle str) = n
  | otherwise = f (repStr [(needle !! 0)] ((length needle) - 1)) str (n - 1)

main :: IO ()
main = do
  n <- getLine
  s <- getLine
  let needle = repStr "." (toInt n)
  print (f needle s (length needle))
