5
ababa
 8
aaabcabc
 7
abcdabc
 29
abbabbaabbbbaababbababbaabbaa
 5
baaaa
 54
dgafkhlgdhjflkdafgjldjhgkjllfallhsggaaahkaggkhgjgflsdg
 7
abcdbcd
 20
ccbbcbaabcccbabcbcaa
 11
ababcabcabc
 9
azxcvzxcv
 10
wvwlwvwwvw
 11
ababababccc
 7
dabcabc
 6
abcabd
 12
ababababvvvv
 11
jjlkalfhdhh
 6
abbbba
 8
ababcdef
 10
ababcababc
 7
ababbcc
 6
ablfab
 45
bbbbbbbabababbbaabbbbbbbbbbbbabbbabbaabbbabab
 100
mhnzadklojbuumkrxjayikjhwuxihgkinllackcavhjpxlydxcmhnzadklojbuumkrxjayikjhwuxihgkinllackcavhjpxlydxc
 5
aaaaa
 99
lhgjlskfgldjgadhdjjgskgakslflalhjfgfaaalkfdfgdkdffdjkjddfgdhalklhsgslskfdhsfjlhgajlgdfllhlsdhlhadaa
 10
adadadadad
 46
kgadjahfdhjajagdkffsdfjjlsksklgkshfjkjdajkddlj
 7
aabcdaa
 1
s
 4
ttob
 16
abcdabcdabcdabcd
 1
a
 37
lglfddsjhhaagkakadffkllkaagdaagdfdahg
 7
aabaaaa
 12
abaabaabaaba
 27
aaaaaaaaaaaaaaaaaaaaaaaaaaa
 17
abcdefggggglelsoe
 32
bbbbaaabbaabbaabbabaaabaabaabaab
 9
abbbbabbb
 10
asdasdasda
 10
bbbbbbbbbc
 11
abcabcabcab
 20
aabaabaabaabaabaabaa
 8
abcabcde
 6
abcaca
 7
aabcabc
 100
yeywsnxcwslfyiqbbeoaawtmioksfdndptxxcwzfmrpcixjbzvicijofjrbcvzaedglifuoczgjlqylddnsvsjfmfsccxbdveqgu
 16
bbbbbbaaaaaaaaaa
 77
babbaababaabbaaaabbaababbbabaaaabbabaaaaaaaabbbaaabbabbbabaababbabaabbbbaaabb
 8
aaaaaaaa
 6
ababab
 3
lsl
 12
wwvwwvwwvwwv
 10
ababababab
 8
ffffffff
 10
abcdeeeeee
 8
abbbbbba
 16
uuuuuuuuuuuuuuuu
 9
baaaabaaa
 7
zabcabc
 6
aaaaaa
 8
abcdeabc
 12
ababababbbbb
 14
abcdefgabcdepq
 6
ajkoaj
 3
aaa
 81
aaaaaababaabaaaabaaaaaaaabbabbbbbabaabaabbaaaababaabaababbbabbaababababbbbbabbaaa
 8
abcdefef
 8
abbababa
 9
abcdeabcd
 14
abcabcabcabcjj
 8
acacacac
 86
ssjskldajkkskhljfsfkjhskaffgjjkskgddfslgjadjjgdjsjfsdgdgfdaldffjkakhhdaggalglakhjghssg
 11
abcdeabcdfg
 38
asdsssdssjajghslfhjdfdhhdggdsdfsfajfas
 10
bbbbbbbaaa
 8
baaaaaaa
 5
abcbc
 8
ababcabc
 66
ldldgjllllsdjgllkfljsgfgjkflakgfsklhdhhallggagdkgdgjggfshagjgkdfld
 92
bbbbbabbbaaaabaaababbbaabbaabaaabbaabababaabbaabaabbbaabbaaabaabbbbaabbbabaaabbbabaaaaabaaaa
 10
abcabcabca
 5
aabaa
 12
abcabcabcabc
 8
aaaabcde
 8
abbbbbbb
 10
abcabcdddd
 20
abcdabcdeeeeeeeeabcd
 5
abbbb
 16
aaaaaabbaaaaaabb
 10
aaaacaaaac
 10
aaaaaaaaaa
 7
abababa
 8
aaaaaass
 7
abacbac
 36
bbabbaabbbabbbbbabaaabbabbbabaabbbab
 8
aabcabca
 10
abccaaaaba
 8
asafaass
 14
aaabcabcabcabc
 79
lsfgfhhhkhklfdffssgffaghjjfkjsssjakglkajdhfkasfdhjhlkhsgsjfgsjghglkdkalaajsfdka
 7
mabcabc
 17
ababababzabababab
 8
abababaa
 10
abcdabcefg
 17
abcdefgggggabcdef
 13
eabcdefabcdef
 8
abababab
 28
aaaaaaaaaaaaaaibfprdokxvipsq
 13
aabbbkaakbbbb
 4
abab
 9
zabcdabcd
 70
babababbabababbbabaababbababaabaabbaaabbbbaababaabaabbbbbbaaabaabbbabb
 9
abcabcabc
 2
aa
 100
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 4
aaaa
 36
babbbbababaaabbabbbaabaabbbbbbbbbbba
 9
asdfgasdf
 13
aabaabaabaabx
 95
bbaaaabaababbbabaaaabababaaaaaabbababbaabbaaabbbaaaabaaaaaaababababbabbbaaaabaabaababbbbbababaa
 5
xabab
 20
hhhhhhhhhhhhhhhhhhhh
 41
abbababbbbbabbbabaaaababaaabaabaaabbbbbbb
 8
pppppppp
 5
abcab
 10
avavavavbc
 12
aaaaaaaaaaaa
 63
jhkjhadlhhsfkadalssaaggdagggfahsakkdllkhldfdskkjssghklkkgsfhsks
 9
aaaaaaaaa
 6
abcbcd
 16
aaaaaaaaaaaaaaaa
 9
asdfpasdf
 12
aabaabaabaab
 74
ghhhfaddfslafhhshjflkjdgksfashhllkggllllsljlfjsjhfggkgjfalgajaldgjfghlhdsh
 39
jflfashaglkahldafjasagasjghjkkjgkgffgkk
 10
adcbeadcfg
 5
cabab
 6
ababbb
 99
trolnjmzxxrfxuexcqpjvefndwuxwsukxwmjhhkqmlzuhrplrtrolnjmzxxrfxuexcqpjvefndwuxwsukxwmjhhkqmlzuhrplrm
 7
abcaabc
 6
aabbbb
 87
fhjgjjagajllljffggjjhgfffhfkkaskksaalhksfllgdjsldagshhlhhgslhjaaffkahlskdagsfasfkgdfjka
 8
baaaaaab
 5
aavaa
 5
aabab

4
 8
 7
 27
 5
 54
 7
 20
 10
 9
 10
 8
 7
 6
 9
 11
 6
 7
 6
 6
 6
 43
 51
 4
 99
 7
 46
 7
 1
 4
 9
 1
 37
 7
 7
 15
 17
 31
 9
 8
 7
 9
 12
 6
 6
 7
 100
 14
 77
 5
 5
 3
 7
 7
 5
 10
 8
 9
 9
 7
 4
 8
 9
 14
 6
 3
 79
 8
 8
 9
 9
 5
 86
 11
 38
 8
 8
 5
 7
 65
 91
 8
 5
 7
 7
 8
 8
 17
 5
 9
 6
 6
 6
 6
 7
 34
 8
 10
 8
 14
 79
 7
 14
 7
 10
 17
 13
 5
 22
 13
 3
 9
 64
 7
 2
 51
 3
 36
 9
 8
 95
 5
 11
 41
 5
 5
 7
 7
 63
 6
 6
 9
 9
 7
 74
 39
 10
 5
 5
 51
 7
 6
 87
 8
 5
 5


					import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.InputMismatchException;
									public class Solution1 implements Runnable
									{
										static final long MAX = 1000000007L;
										static class InputReader
										{
											private InputStream stream;
											private byte[] buf = new byte[1024];
											private int curChar;
											private int numChars;
											private SpaceCharFilter filter;
											private BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
									 
											public InputReader(InputStream stream)
											{
												this.stream = stream;
											}
											
											public int read()
											{
												if (numChars==-1) 
													throw new InputMismatchException();
												
												if (curChar >= numChars)
												{
													curChar = 0;
													try 
													{
														numChars = stream.read(buf);
													}
													catch (IOException e)
													{
														throw new InputMismatchException();
													}
													
													if(numChars <= 0)				
														return -1;
												}
												return buf[curChar++];
											}
										 
											public String nextLine()
											{
												String str = "";
									            try
									            {
									                str = br.readLine();
									            }
									            catch (IOException e)
									            {
									                e.printStackTrace();
									            }
									            return str;
											}
											public int nextInt()
											{
												int c = read();
												
												while(isSpaceChar(c)) 
													c = read();
												
												int sgn = 1;
												
												if (c == '-') 
												{
													sgn = -1;
													c = read();
												}
												
												int res = 0;
												do 
												{
													if(c<'0'||c>'9') 
														throw new InputMismatchException();
													res *= 10;
													res += c - '0';
													c = read();
												}
												while (!isSpaceChar(c)); 
												
												return res * sgn;
											}
											
											public long nextLong() 
											{
												int c = read();
												while (isSpaceChar(c))
													c = read();
												int sgn = 1;
												if (c == '-') 
												{
													sgn = -1;
													c = read();
												}
												long res = 0;
												
												do 
												{
													if (c < '0' || c > '9')
														throw new InputMismatchException();
													res *= 10;
													res += c - '0';
													c = read();
												}
												while (!isSpaceChar(c));
													return res * sgn;
											}
											
											public double nextDouble() 
											{
												int c = read();
												while (isSpaceChar(c))
													c = read();
												int sgn = 1;
												if (c == '-') 
												{
													sgn = -1;
													c = read();
												}
												double res = 0;
												while (!isSpaceChar(c) && c != '.') 
												{
													if (c == 'e' || c == 'E')
														return res * Math.pow(10, nextInt());
													if (c < '0' || c > '9')
														throw new InputMismatchException();
													res *= 10;
													res += c - '0';
													c = read();
												}
												if (c == '.') 
												{
													c = read();
													double m = 1;
													while (!isSpaceChar(c)) 
													{
														if (c == 'e' || c == 'E')
															return res * Math.pow(10, nextInt());
														if (c < '0' || c > '9')
															throw new InputMismatchException();
														m /= 10;
														res += (c - '0') * m;
														c = read();
													}
												}
												return res * sgn;
											}
											
											public String readString() 
											{
												int c = read();
												while (isSpaceChar(c))
													c = read();
												StringBuilder res = new StringBuilder();
												do 
												{
													res.appendCodePoint(c);
													c = read();
												} 
												while (!isSpaceChar(c));
												
												return res.toString();
											}
										 
											public boolean isSpaceChar(int c) 
											{
												if (filter != null)
													return filter.isSpaceChar(c);
												return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
											}
										 
											public String next() 
											{
												return readString();
											}
											
											public interface SpaceCharFilter 
											{
												public boolean isSpaceChar(int ch);
											}
										}
									 	
										public static void main(String args[]) throws Exception
										{
											new Thread(null, new Solution1(),"Solution1",1<<26).start();
										}
										long gcd(long a, long b)
									    {
									        if (a == 0)
									            return b;
									         
									        return gcd(b%a, a);
									    }
									    // method to return LCM of two numbers
										 long lcm(long a, long b)
										    {
										        return (a*b)/gcd(a, b);
										    }
										
										public void run()
										{
											InputReader sc= new InputReader(System.in);
											PrintWriter w= new PrintWriter(System.out);
											int n = sc.nextInt();
											String s = sc.next();
											ArrayList<Integer> ar[] = new ArrayList[26];
											for(int i = 0;i < 26;i++){
												ar[i] = new ArrayList();
											}
											char tmp = '2';
											for(int i = 0;i < s.length();i++){
												if(i == 0){
													tmp = s.charAt(i);
												}
												ar[s.charAt(i)-97].add(i);
											}
											int ans = 0;
											for(int i = tmp-97;;){
												for(int j = 0;j < 1;j++){
													for(int k = j+1;k < ar[i].size();k++){
														String temp = s.substring(ar[i].get(j),ar[i].get(k));
														int e = Math.min(s.length(),ar[i].get(k) + temp.length());	
														String temp2 = s.substring(ar[i].get(k),e);
														if(temp.equals(temp2)){
															ans = Math.max(ans,temp.length());
														}
													}
												}
												break;
											}
											w.println(ans != 0 ? n - ans + 1 : n);
											w.close();
										}
										
										static class Pair implements Comparable<Pair>{
											int a;
											int b;
											
											Pair(){}	
											Pair(int a,int b){
												this.a = a;
												this.b = b;
												
											}
											public int compareTo(Pair p){
												return Integer.compare(this.b,p.b);
											}
										}
						}